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@xxxxxxxxx> > --- > 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@xxxxxxxxxx> regards, dan carpenter