diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2014-05-15 14:28:45 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-05-15 18:08:35 +0200 |
commit | 84237bfb0b112a18a7c5d4d35a0663c97bdd14c6 (patch) | |
tree | 0593ddc08bdd36dd99e4cf9f212621c2b6710000 /drivers/usb | |
parent | usb: gadget: uvc: Set the vb2 queue timestamp flags (diff) | |
download | linux-84237bfb0b112a18a7c5d4d35a0663c97bdd14c6.tar.xz linux-84237bfb0b112a18a7c5d4d35a0663c97bdd14c6.zip |
usb: gadget: net2280: Fix NULL pointer dereference
When DEBUG is enabled driver->driver.name is accessed, but driver
can be NULL
[ 174.411689] BUG: unable to handle kernel NULL pointer dereference at 0000000000000040
[ 174.429043] RIP: 0010:[<ffffffffa0131ca3>] [<ffffffffa0131ca3>] net2280_stop+0xa3/0x100 [net2280]
[ 174.457910] Call Trace:
[ 174.459503] [<ffffffffa00dd92a>] usb_gadget_remove_driver+0x5a/0xb0 [udc_core]
[ 174.462693] [<ffffffffa00ddd84>] usb_del_gadget_udc+0xb4/0x110 [udc_core]
[ 174.464316] [<ffffffffa012e2bf>] net2280_remove+0x2f/0x1c0 [net2280]
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/net2280.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c index 43e5e2f9888f..300b3a71383b 100644 --- a/drivers/usb/gadget/net2280.c +++ b/drivers/usb/gadget/net2280.c @@ -1972,7 +1972,9 @@ static int net2280_stop(struct usb_gadget *_gadget, device_remove_file (&dev->pdev->dev, &dev_attr_function); device_remove_file (&dev->pdev->dev, &dev_attr_queues); - DEBUG (dev, "unregistered driver '%s'\n", driver->driver.name); + DEBUG(dev, "unregistered driver '%s'\n", + driver ? driver->driver.name : ""); + return 0; } |