From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: balbi@ti.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
joe@perches.com, auttamchandani@logicube.com
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Subject: [PATCH 1/2 v4] usb: gadget: net2280: Fix NULL pointer dereference
Date: Thu, 15 May 2014 14:28:45 +0200 [thread overview]
Message-ID: <1400156926-11100-1-git-send-email-ricardo.ribalda@gmail.com> (raw)
When DEBUG is enabled driver->driver.name is accessed, but driver
can be NULL
[ 174.411689] BUG: unable to handle kernel NULL pointer dereference at 0000000000000040
[ 174.429043] RIP: 0010:[<ffffffffa0131ca3>] [<ffffffffa0131ca3>] net2280_stop+0xa3/0x100 [net2280]
[ 174.457910] Call Trace:
[ 174.459503] [<ffffffffa00dd92a>] usb_gadget_remove_driver+0x5a/0xb0 [udc_core]
[ 174.462693] [<ffffffffa00ddd84>] usb_del_gadget_udc+0xb4/0x110 [udc_core]
[ 174.464316] [<ffffffffa012e2bf>] net2280_remove+0x2f/0x1c0 [net2280]
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
v4: Replace if with terniary operator
drivers/usb/gadget/net2280.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 43e5e2f..300b3a7 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -1972,7 +1972,9 @@ static int net2280_stop(struct usb_gadget *_gadget,
device_remove_file (&dev->pdev->dev, &dev_attr_function);
device_remove_file (&dev->pdev->dev, &dev_attr_queues);
- DEBUG (dev, "unregistered driver '%s'\n", driver->driver.name);
+ DEBUG(dev, "unregistered driver '%s'\n",
+ driver ? driver->driver.name : "");
+
return 0;
}
--
2.0.0.rc0
next reply other threads:[~2014-05-15 12:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 12:28 Ricardo Ribalda Delgado [this message]
2014-05-15 12:28 ` [PATCH 2/2 v4] usb: gadget: net2280: Add support for PLX USB338X Ricardo Ribalda Delgado
2014-05-15 16:07 ` Felipe Balbi
2014-05-15 16:34 ` Ricardo Ribalda Delgado
2014-05-15 19:12 ` Alan Stern
2014-05-15 18:40 ` Joe Perches
2014-05-19 10:04 ` Ricardo Ribalda Delgado
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=1400156926-11100-1-git-send-email-ricardo.ribalda@gmail.com \
--to=ricardo.ribalda@gmail.com \
--cc=auttamchandani@logicube.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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
all inboxes | Powered by JetHome®