lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5] staging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp()
On Thu, Apr 21, 2022 at 04:21:17PM +0800, Haowen Bai wrote:
> The rtllib_rx_assoc_resp() function has a signedness bug because it's
> a declared as a u16 but it return -ENOMEM. When you look at it more
> closely it returns a mix of error codes including 0xcafe, -ENOMEM, and
> a->status which is WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG. This is a mess.
>
> Clean it up to just return standard kernel error codes. We can print
> out the a->status before returning a regular error code. The printks
> in the caller need to be adjusted as well.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> V1->V2: reduce return random value; print its own error message.
> V2->V3: change commit message; change s16 -> int.
> V3->V4:
> 1. change message suggested by Dan Carpenter;
> 2. hold a->status in auth_parse() and return error code or 0 on success.
> 3. print le16_to_cpu(errcode) -> int %d.
> V4->V5: fix compile error.
>

Looks ok.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-04-21 18:28    [W:0.098 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site