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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Jan 2017 10:46:16 +0100
From:   Christian Gromm <christian.gromm@...rochip.com>
To:     Eric Salem <ericsalem@...il.com>
CC:     <gregkh@...uxfoundation.org>, <andrey.shvetsov@....de>,
        <devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: most: hdm-usb: Fix sparse warning cast to
 restricted __le16

On Mon, 9 Jan 2017 21:25:56 -0600
Eric Salem <ericsalem@...il.com> wrote:

> Fixed the following sparse warning:
> 
> drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning:
> cast to restricted __le16
> 
> by correcting the variable's type (also updated sizeof).
> 
> Signed-off-by: Eric Salem <ericsalem@...il.com>

Acked-by: Christian Gromm <christian.gromm@...rochip.com>

> ---
>  drivers/staging/most/hdm-usb/hdm_usb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
> index d6db0bd..01e3a31 100644
> --- a/drivers/staging/most/hdm-usb/hdm_usb.c
> +++ b/drivers/staging/most/hdm-usb/hdm_usb.c
> @@ -145,7 +145,7 @@ static void wq_netinfo(struct work_struct *wq_obj);
>  static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf)
>  {
>  	int retval;
> -	u16 *dma_buf = kzalloc(sizeof(u16), GFP_KERNEL);
> +	__le16 *dma_buf = kzalloc(sizeof(*dma_buf), GFP_KERNEL);
>  	u8 req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE;
>  
>  	if (!dma_buf)
> @@ -154,7 +154,7 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf)
>  	retval = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
>  				 DRCI_READ_REQ, req_type,
>  				 0x0000,
> -				 reg, dma_buf, sizeof(u16), 5 * HZ);
> +				 reg, dma_buf, sizeof(*dma_buf), 5 * HZ);
>  	*buf = le16_to_cpu(*dma_buf);
>  	kfree(dma_buf);
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ