summaryrefslogtreecommitdiff
path: root/drivers/net/irda
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel.ortiz@nokia.com>2006-04-14 16:02:07 -0700
committerDavid S. Miller <davem@davemloft.net>2006-04-14 16:02:07 -0700
commit269690ac164fc0a7c2de03e7e0d2f554104d1516 (patch)
tree52c3fa23e1f100df0acdf68f946a908e39ddedb9 /drivers/net/irda
parent4909e488f65fc729fc0f8d42bd1600c56a8bd83c (diff)
downloadlinux-3.10-269690ac164fc0a7c2de03e7e0d2f554104d1516.tar.gz
linux-3.10-269690ac164fc0a7c2de03e7e0d2f554104d1516.tar.bz2
linux-3.10-269690ac164fc0a7c2de03e7e0d2f554104d1516.zip
[IRDA]: irda-usb, unregister netdev when patch upload fails
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. Signed-off-by: Samuel Ortiz <samuel.ortiz@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r--drivers/net/irda/irda-usb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 606243d1179..96bdb73c228 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1815,14 +1815,14 @@ static int irda_usb_probe(struct usb_interface *intf,
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_interface *intf,
return 0;
+err_out_5:
+ unregister_netdev(self->netdev);
err_out_4:
kfree(self->speed_buff);
err_out_3: