Skip to contentSkip to conversation

IrDA: irda-usb, unregister netdev when patch upload fails

PATCH Applied Samuel Ortiz 2 participants 2 messages Apr 14, 2006

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

PATCH 1/1 IrDA: irda-usb, unregister netdev when patch upload fails

Hi David,

In the STIR421x case, when the firmware upload fails, we need to unregister_netdev. Otherwise we hit a BUG on free_netdev(), if sysfs is enabled.

drivers/net/irda/irda-usb.c +4 -2
index 606243d..96bdb73 100644
@@ -1815,14 +1815,14 @@ static int irda_usb_probe(struct usb_int
 		self->needspatch = (ret < 0);
 		if (ret < 0) {
 			printk("patch_device failed\n");
-			goto err_out_4;
+			goto err_out_5;
 		}
 
 		/* replace IrDA class descriptor with what patched device is now reporting */
 		irda_desc = irda_usb_find_class_desc (self->usbintf);
 		if (irda_desc == NULL) {
 			ret = -ENODEV;
-			goto err_out_4;
+			goto err_out_5;
 		}
 		if (self->irda_desc)
 			kfree (self->irda_desc);
@@ -1832,6 +1832,8 @@ static int irda_usb_probe(struct usb_int
 
 	return 0;
 
+err_out_5:
+	unregister_netdev(self->netdev);
 err_out_4:
 	kfree(self->speed_buff);
 err_out_3:
maintainer Applied
#1 lore raw

From: Samuel Ortiz <[email protected]>
Date: Fri, 14 Apr 2006 13:16:07 +0300

Quoted 5 lines

Hi David,

In the STIR421x case, when the firmware upload fails, we need to unregister_netdev. Otherwise we hit a BUG on free_netdev(), if sysfs is enabled.

Applied, but please become familiar with the carriage return key on your keyboard and format your changelog descirptions to ~80 columns.

Thanks.