From: Maarten ter Huurne Date: Mon, 19 Aug 2013 06:24:08 +0000 (+0200) Subject: usb: musb: avoid null pointer dereference in debug logging X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b130f03fd2b156ba0d1f82f8b3d9624fe342753e;p=linux-beck.git 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 696e9e0b05af..b7b8b2bc4ee9 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -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;