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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d232a54761a7473692976188aba0a5f6@AcuMS.aculab.com>
Date:   Mon, 14 Dec 2020 11:26:22 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Pawel Laszczak' <pawell@...ence.com>,
        "peter.chen@....com" <peter.chen@....com>
CC:     "rogerq@...com" <rogerq@...com>,
        "a-govindraju@...com" <a-govindraju@...com>,
        "nsekhar@...com" <nsekhar@...com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kurahul@...ence.com" <kurahul@...ence.com>
Subject: RE: [PATCH] usb: cdns3: Fixes for sparse warnings

From: Pawel Laszczak
> Sent: 14 December 2020 11:05
> 
> Patch fixes the following warnings:
...
> cdns3-ep0.c:367: sparse: warning: restricted __le16 degrades to integer
...
> diff --git a/drivers/usb/cdns3/cdns3-ep0.c b/drivers/usb/cdns3/cdns3-ep0.c
> index b0390fe9a396..9a17802275d5 100644
> --- a/drivers/usb/cdns3/cdns3-ep0.c
> +++ b/drivers/usb/cdns3/cdns3-ep0.c
> @@ -364,7 +364,7 @@ static int cdns3_ep0_feature_handle_endpoint(struct cdns3_device *priv_dev,
>  	if (le16_to_cpu(ctrl->wValue) != USB_ENDPOINT_HALT)
>  		return -EINVAL;
> 
> -	if (!(ctrl->wIndex & ~USB_DIR_IN))
> +	if (!(le16_to_cpu(ctrl->wIndex) & ~USB_DIR_IN))
>  		return 0;

It's generally best to byteswap the constant.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ