diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 085121c2b47..7a1a7830a6b 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c @@ -613,6 +613,7 @@ static int __devinit cx18_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) { int retval = 0; + int i; int vbi_buf_size; u32 devtype; struct cx18 *cx; @@ -698,7 +699,8 @@ static int __devinit cx18_probe(struct pci_dev *dev, /* active i2c */ CX18_DEBUG_INFO("activating i2c...\n"); - if (init_cx18_i2c(cx)) { + retval = init_cx18_i2c(cx); + if (retval) { CX18_ERR("Could not initialize i2c\n"); goto free_map; } @@ -836,8 +838,11 @@ err: CX18_ERR("Error %d on initialization\n", retval); cx18_log_statistics(cx); - kfree(cx18_cards[cx18_cards_active]); - cx18_cards[cx18_cards_active] = NULL; + i = cx->num; + spin_lock(&cx18_cards_lock); + kfree(cx18_cards[i]); + cx18_cards[i] = NULL; + spin_unlock(&cx18_cards_lock); return retval; } |