usb: usbip: remove null check
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 6 Jun 2016 21:23:32 +0000 (22:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jun 2016 05:18:39 +0000 (22:18 -0700)
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>
drivers/usb/usbip/vudc_sysfs.c

index 99397fa1e3f0eb7400a927157cb3e1eae6a936b4..0f98f2c7475f5d95a0eff25b3bf8e5db5408f4cf 100644 (file)
@@ -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;