public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: usbip: remove null check
@ 2016-06-06 21:23 Sudip Mukherjee
  2016-06-06 21:30 ` Krzysztof Opasiak
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2016-06-06 21:23 UTC (permalink / raw)
  To: Valentina Manea, Shuah Khan, Greg Kroah-Hartman
  Cc: linux-kernel, linux-usb, k.opasiak, stern, Sudip Mukherjee

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@codethink.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;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: usbip: remove null check
  2016-06-06 21:23 [PATCH] usb: usbip: remove null check Sudip Mukherjee
@ 2016-06-06 21:30 ` Krzysztof Opasiak
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Opasiak @ 2016-06-06 21:30 UTC (permalink / raw)
  To: Sudip Mukherjee, Valentina Manea, Shuah Khan, Greg Kroah-Hartman
  Cc: linux-kernel, linux-usb, stern



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@codethink.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@samsung.com>
-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-06 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-06 21:23 [PATCH] usb: usbip: remove null check Sudip Mukherjee
2016-06-06 21:30 ` Krzysztof Opasiak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox