]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp()
authorHaowen Bai <baihaowen@meizu.com>
Thu, 21 Apr 2022 08:21:17 +0000 (16:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Apr 2022 14:42:30 +0000 (16:42 +0200)
commit7c85972ae8f57c2f38ee4acc9fb7868a812a9c50
tree68adf2969f8cbd3a7624f94694dd43dfa4fb0de6
parent3099fb57670ccc6e953e7aa3e10524007759c488
staging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp()

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.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650529277-7893-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_softmac.c