Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753675Ab3HRQVx (ORCPT ); Sun, 18 Aug 2013 12:21:53 -0400 Received: from smtp-vbr5.xs4all.nl ([194.109.24.25]:4352 "EHLO smtp-vbr5.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752798Ab3HRQVw (ORCPT ); Sun, 18 Aug 2013 12:21:52 -0400 From: Maarten ter Huurne To: Felipe Balbi Cc: Alan Stern , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Maarten ter Huurne Subject: [PATCH] USB: musb: Avoid null pointer dereference in debug logging Date: Sun, 18 Aug 2013 18:21:04 +0200 Message-Id: <1376842864-27839-1-git-send-email-maarten@treewalker.org> X-Mailer: git-send-email 1.8.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 30 Since commit 511f3c53 usb_gadget_remove_driver will pass NULL for the driver argument. Signed-off-by: Maarten ter Huurne --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/