linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB: musb: Avoid null pointer dereference in debug logging
@ 2013-08-18 16:21 Maarten ter Huurne
  2013-08-18 22:06 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Maarten ter Huurne @ 2013-08-18 16:21 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Alan Stern, linux-usb, linux-kernel, Maarten ter Huurne

Since commit 511f3c53 usb_gadget_remove_driver will pass NULL for the
driver argument.

Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
---
 drivers/usb/musb/musb_gadget.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index ba70923..82e5386 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1935,7 +1935,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;
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-19  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-18 16:21 [PATCH] USB: musb: Avoid null pointer dereference in debug logging Maarten ter Huurne
2013-08-18 22:06 ` Sergei Shtylyov
2013-08-19  6:24   ` Maarten ter Huurne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).