usb: musb: avoid null pointer dereference in debug logging

Since commit 511f3c53 (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>
This commit is contained in:
Maarten ter Huurne 2013-08-19 08:24:08 +02:00 committed by Felipe Balbi
parent 0b5c1e62d8
commit b130f03fd2

View 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;