Re: [PATCH V4] staging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 15, 2022 at 02:39:27PM +0800, Haowen Bai wrote:
> This commit message suggested by Dan Carpenter as below:

You don't need to add this.  If you feel you must then put it below the
--- cut off line and it will be stored on lore.kernel.org until the end
of time.

> @@ -2292,8 +2298,8 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb)
>  	if (errcode) {
>  		ieee->softmac_stats.rx_auth_rs_err++;
>  		netdev_info(ieee->dev,
> -			    "Authentication response status code 0x%x",
> -			    errcode);
> +			    "Authentication response status code %d",
> +			    le16_to_cpu(errcode));

The error code is not a le16.  It's just an int.  The way to prevent
these kinds of issues in the future is to run Sparse with the endian
checking enabled.

https://lwn.net/Articles/205624/

regards,
dan carpenter





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux