]> git.baikalelectronics.ru Git - kernel.git/commitdiff
usb: musb: avoid null pointer dereference in debug logging
authorMaarten ter Huurne <maarten@treewalker.org>
Mon, 19 Aug 2013 06:24:08 +0000 (08:24 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 27 Aug 2013 19:16:57 +0000 (14:16 -0500)
Since commit 916c454c (usb: gadget: udc-core: fix a regression during
gadget driver unbinding) usb_gadget_remove_driver will pass NULL for
the driver argument.

Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_gadget.c

index 696e9e0b05af7f7ce2936df4ffcebc4397cfc20e..b7b8b2bc4ee9de02bb7e65cd2245b7e9460af537 100644 (file)
@@ -1937,7 +1937,8 @@ static int musb_gadget_stop(struct usb_gadget *g,
        stop_activity(musb, driver);
        otg_set_peripheral(musb->xceiv->otg, NULL);
 
-       dev_dbg(musb->controller, "unregistering driver %s\n", driver->function);
+       dev_dbg(musb->controller, "unregistering driver %s\n",
+                                 driver ? driver->function : "(removed)");
 
        musb->is_active = 0;
        musb->gadget_driver = NULL;