Skip to contentSkip to conversation

Staging: line6: NULL dereference in dev_err()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 30, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: line6: NULL dereference in dev_err()

"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.

drivers/staging/line6/driver.c +3 -3
index a71a5af..a2f48ee 100644
@@ -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;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dan Carpenter

"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.

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html