* [PATCH 2/4] tm6000: More robust error handling in tm6000_usb_probe()
@ 2009-04-05 0:46 Kevin Wells
0 siblings, 0 replies; only message in thread
From: Kevin Wells @ 2009-04-05 0:46 UTC (permalink / raw)
To: Steven Toth; +Cc: linux-media
# HG changeset patch
# User Kevin Wells <kevin.wells@kahusoft.com>
# Date 1238841558 -46800
# Node ID 3140e621a17b536eb1487f8f9ad5b7b6a8ff8341
# Parent a293d5babca03bb5a7f21ecb659d55e447194e49
More robust error handling in tm6000_usb_probe()
From: Kevin Wells <kevin.wells@kahusoft.com>
Priority: normal
Signed-off-by: Kevin Wells <kevin.wells@kahusoft.com>
diff -r a293d5babca0 -r 3140e621a17b
linux/drivers/media/video/tm6000/tm6000-cards.c
--- a/linux/drivers/media/video/tm6000/tm6000-cards.c Sat Apr 04
23:07:00 2009 +1300
+++ b/linux/drivers/media/video/tm6000/tm6000-cards.c Sat Apr 04
23:39:18 2009 +1300
@@ -373,22 +373,22 @@
/* Selects the proper interface */
rc=usb_set_interface(usbdev,0,1);
if (rc<0)
- goto err;
+ goto err1;
/* Check to see next free device and mark as used */
nr=find_first_zero_bit(&tm6000_devused,TM6000_MAXBOARDS);
if (nr >= TM6000_MAXBOARDS) {
printk("tm6000: Only supports %i boards.\n", TM6000_MAXBOARDS);
- usb_put_dev(usbdev);
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto err1;
}
/* Create and initialize dev struct */
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
printk ("tm6000" ": out of memory!\n");
- usb_put_dev(usbdev);
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto err1;
}
spin_lock_init(&dev->slock);
@@ -495,8 +495,7 @@
if (!dev->isoc_in) {
printk("tm6000: probing error: no IN ISOC endpoint!\n");
rc= -ENODEV;
-
- goto err;
+ goto err2;
}
/* save our data pointer in this interface device */
@@ -514,15 +513,17 @@
rc=tm6000_init_dev(dev);
if (rc<0)
- goto err;
+ goto err3;
return 0;
-err:
+err3:
+ usb_set_intfdata(interface, NULL);
+err2:
tm6000_devused&=~(1<<nr);
+ kfree(dev);
+err1:
usb_put_dev(usbdev);
-
- kfree(dev);
return rc;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-05 0:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-05 0:46 [PATCH 2/4] tm6000: More robust error handling in tm6000_usb_probe() Kevin Wells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox