public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] Staging: line6: NULL dereference in dev_err()
@ 2011-11-30  8:43 Dan Carpenter
  2011-11-30  9:00 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-11-30  8:43 UTC (permalink / raw)
  To: kernel-janitors

"line6" hasn't been set at this point and we should be using
&interface->dev instead.

Gcc would have complained about this if it weren't for the fact that we
initialized line6 to NULL.  I removed the initialization.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index a71a5af..a2f48ee 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -726,8 +726,8 @@ static int line6_probe(struct usb_interface *interface,
 		       const struct usb_device_id *id)
 {
 	int devtype;
-	struct usb_device *usbdev = NULL;
-	struct usb_line6 *line6 = NULL;
+	struct usb_device *usbdev;
+	struct usb_line6 *line6;
 	const struct line6_properties *properties;
 	int devnum;
 	int interface_number, alternate = 0;
@@ -936,7 +936,7 @@ static int line6_probe(struct usb_interface *interface,
 	}
 
 	if (size = 0) {
-		dev_err(line6->ifcdev,
+		dev_err(&interface->dev,
 			"driver bug: interface data size not set\n");
 		ret = -ENODEV;
 		goto err_put;

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

* Re: [patch] Staging: line6: NULL dereference in dev_err()
  2011-11-30  8:43 [patch] Staging: line6: NULL dereference in dev_err() Dan Carpenter
@ 2011-11-30  9:00 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2011-11-30  9:00 UTC (permalink / raw)
  To: kernel-janitors

On Wed, Nov 30, 2011 at 8:43 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> "line6" hasn't been set at this point and we should be using
> &interface->dev instead.
>
> Gcc would have complained about this if it weren't for the fact that we
> initialized line6 to NULL.  I removed the initialization.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2011-11-30  9:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-30  8:43 [patch] Staging: line6: NULL dereference in dev_err() Dan Carpenter
2011-11-30  9:00 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox