]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: usbip: Avoid NULL pointer dereference in case of error
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Fri, 29 Apr 2016 10:34:13 +0000 (12:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 22:31:30 +0000 (15:31 -0700)
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>
drivers/usb/usbip/vudc_sysfs.c

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