usb: usbip: Avoid NULL pointer dereference in case of error
One line above we have checked that udc is NULL so we shouldn't
dereference it while printing error message.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c
index 40d5c8f..99397fa 100644
--- a/drivers/usb/usbip/vudc_sysfs.c
+++ b/drivers/usb/usbip/vudc_sysfs.c
@@ -201,7 +201,7 @@
int status;
if (!udc) {
- dev_err(&udc->pdev->dev, "no device");
+ dev_err(dev, "no device");
return -ENODEV;
}
spin_lock_irq(&udc->ud.lock);