Skip to content

Commit

Permalink
usb: usbip: remove null check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sudip Mukherjee authored and Greg Kroah-Hartman committed Jun 8, 2016
1 parent 600bb21 commit 7c348f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/usbip/vudc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c348f1

Please sign in to comment.