Skip to content

Commit

Permalink
Staging: line6: NULL dereference in dev_err()
Browse files Browse the repository at this point in the history
"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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Dec 1, 2011
1 parent f75c051 commit 4bd8b4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/line6/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4bd8b4d

Please sign in to comment.