From 442ee366bec3cbdaf5794e80f803d87c5787c5d8 Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Fri, 29 Apr 2016 12:34:13 +0200 Subject: [PATCH] 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 Signed-off-by: Krzysztof Opasiak Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/vudc_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ static ssize_t usbip_status_show(struct device *dev, int status; if (!udc) { - dev_err(&udc->pdev->dev, "no device"); + dev_err(dev, "no device"); return -ENODEV; } spin_lock_irq(&udc->ud.lock); -- 2.7.4