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]
Date:	Mon, 06 Jun 2016 23:30:59 +0200
From:	Krzysztof Opasiak <k.opasiak@...sung.com>
To:	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Valentina Manea <valentina.manea.m@...il.com>,
	Shuah Khan <shuah.kh@...sung.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	stern@...land.harvard.edu
Subject: Re: [PATCH] usb: usbip: remove null check



On 06/06/2016 11:23 PM, Sudip Mukherjee wrote:
> The only caller of get_gadget_descs() has already dereferenced udc
> before calling this function, so udc can not be NULL at this point of
> the code and hence no use of checking it.
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>
> ---
>  drivers/usb/usbip/vudc_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c
> index 99397fa..0f98f2c 100644
> --- a/drivers/usb/usbip/vudc_sysfs.c
> +++ b/drivers/usb/usbip/vudc_sysfs.c
> @@ -40,7 +40,7 @@ int get_gadget_descs(struct vudc *udc)
>  	struct usb_ctrlrequest req;
>  	int ret;
>  
> -	if (!udc || !udc->driver || !udc->pullup)
> +	if (!udc->driver || !udc->pullup)
>  		return -EINVAL;
>  
>  	req.bRequestType = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE;
> 

Reviewed-by: Krzysztof Opasiak <k.opasiak@...sung.com>
-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ