linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maarten ter Huurne <maarten@treewalker.org>
To: Felipe Balbi <balbi@ti.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Maarten ter Huurne <maarten@treewalker.org>
Subject: [PATCH] USB: musb: Avoid null pointer dereference in debug logging
Date: Sun, 18 Aug 2013 18:21:04 +0200	[thread overview]
Message-ID: <1376842864-27839-1-git-send-email-maarten@treewalker.org> (raw)

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


             reply	other threads:[~2013-08-18 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18 16:21 Maarten ter Huurne [this message]
2013-08-18 22:06 ` [PATCH] USB: musb: Avoid null pointer dereference in debug logging Sergei Shtylyov
2013-08-19  6:24   ` Maarten ter Huurne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376842864-27839-1-git-send-email-maarten@treewalker.org \
    --to=maarten@treewalker.org \
    --cc=balbi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).