lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <wrfjr3o1o129.fsf@redhat.com>
Date:	Tue, 21 Jul 2015 13:47:10 -0400
From:	Jes Sorensen <Jes.Sorensen@...hat.com>
To:	Steve Pennington <sgpenn@...il.com>
Cc:	Larry Finger <Larry.Finger@...inger.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Greg Donald <gdonald@...il.com>, Joe Perches <joe@...ches.com>,
	Roberta Dobrescu <roberta.dobrescu@...il.com>,
	Masanari Iida <standby24x7@...il.com>,
	linux-wireless@...r.kernel.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723au: fix incorrect type in assignment warning

Steve Pennington <sgpenn@...il.com> writes:
> Repaced call to htons with call to cpu_to_be16s to fix the
> following sparse warning:
> drivers/staging/rtl8723au/core/rtw_recv.c:1557:21: warning: incorrect type in assignment (different base types)
> drivers/staging/rtl8723au/core/rtw_recv.c:1557:21:    expected unsigned short [unsigned] [assigned] [usertype] len
> drivers/staging/rtl8723au/core/rtw_recv.c:1557:21:    got restricted __be16 [usertype] <noident>
>
> Signed-off-by: Steve Pennington <sgpenn@...il.com>
> ---
>  drivers/staging/rtl8723au/core/rtw_recv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c
> index 274a4b6..39318ae 100644
> --- a/drivers/staging/rtl8723au/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723au/core/rtw_recv.c
> @@ -1554,7 +1554,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)
>  	ether_addr_copy(ptr + ETH_ALEN, pattrib->src);
>  
>  	if (!bsnaphdr) {
> -		len = htons(len);
> +		cpu_to_be16s(&len);
>  		memcpy(ptr + 12, &len, 2);
>  	}

Thats an awful fix - use put_unaligned_le16() instead.

Jes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ