diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2016-06-07 00:23:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-08 08:18:39 +0300 |
commit | 7c348f1cfb6d8c6911fcb6d13b4c267a8bc93856 (patch) | |
tree | 9f56caf6b7dfe6b728dd1bf825857c7f21f7bd38 /drivers/usb/usbip/vudc_sysfs.c | |
parent | 600bb2160546d3310f8f01838b6088569c1b6fdb (diff) | |
download | linux-7c348f1cfb6d8c6911fcb6d13b4c267a8bc93856.tar.xz |
usb: usbip: remove null check
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>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip/vudc_sysfs.c')
-rw-r--r-- | drivers/usb/usbip/vudc_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c index 99397fa1e3f0..0f98f2c7475f 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; |