From 7c348f1cfb6d8c6911fcb6d13b4c267a8bc93856 Mon Sep 17 00:00:00 2001 From: Sudip Mukherjee Date: Mon, 6 Jun 2016 22:23:32 +0100 Subject: 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 Reviewed-by: Krzysztof Opasiak Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/vudc_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/usbip') 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; -- cgit