aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-driver.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 622af634104e..81cbaf7dd51c 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -95,8 +95,14 @@ const u32 yuv_offset[4] = {
95 95
96/* Parameter declarations */ 96/* Parameter declarations */
97static int cardtype[IVTV_MAX_CARDS]; 97static int cardtype[IVTV_MAX_CARDS];
98static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; 98static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
99static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; 99 -1, -1, -1, -1, -1, -1, -1, -1,
100 -1, -1, -1, -1, -1, -1, -1, -1,
101 -1, -1, -1, -1, -1, -1, -1, -1 };
102static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
103 -1, -1, -1, -1, -1, -1, -1, -1,
104 -1, -1, -1, -1, -1, -1, -1, -1,
105 -1, -1, -1, -1, -1, -1, -1, -1 };
100 106
101static int cardtype_c = 1; 107static int cardtype_c = 1;
102static int tuner_c = 1; 108static int tuner_c = 1;
@@ -1242,8 +1248,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
1242 retval = -ENODEV; 1248 retval = -ENODEV;
1243 IVTV_ERR("Error %d on initialization\n", retval); 1249 IVTV_ERR("Error %d on initialization\n", retval);
1244 1250
1251 spin_lock(&ivtv_cards_lock);
1245 kfree(ivtv_cards[ivtv_cards_active]); 1252 kfree(ivtv_cards[ivtv_cards_active]);
1246 ivtv_cards[ivtv_cards_active] = NULL; 1253 ivtv_cards[ivtv_cards_active] = NULL;
1254 spin_unlock(&ivtv_cards_lock);
1247 return retval; 1255 return retval;
1248} 1256}
1249 1257
@@ -1346,6 +1354,7 @@ static void module_cleanup(void)
1346 1354
1347 pci_unregister_driver(&ivtv_pci_driver); 1355 pci_unregister_driver(&ivtv_pci_driver);
1348 1356
1357 spin_lock(&ivtv_cards_lock);
1349 for (i = 0; i < ivtv_cards_active; i++) { 1358 for (i = 0; i < ivtv_cards_active; i++) {
1350 if (ivtv_cards[i] == NULL) 1359 if (ivtv_cards[i] == NULL)
1351 continue; 1360 continue;
@@ -1354,6 +1363,7 @@ static void module_cleanup(void)
1354 } 1363 }
1355 kfree(ivtv_cards[i]); 1364 kfree(ivtv_cards[i]);
1356 } 1365 }
1366 spin_unlock(&ivtv_cards_lock);
1357} 1367}
1358 1368
1359/* Note: These symbols are exported because they are used by the ivtv-fb 1369/* Note: These symbols are exported because they are used by the ivtv-fb
@@ -1361,6 +1371,7 @@ static void module_cleanup(void)
1361EXPORT_SYMBOL(ivtv_set_irq_mask); 1371EXPORT_SYMBOL(ivtv_set_irq_mask);
1362EXPORT_SYMBOL(ivtv_cards_active); 1372EXPORT_SYMBOL(ivtv_cards_active);
1363EXPORT_SYMBOL(ivtv_cards); 1373EXPORT_SYMBOL(ivtv_cards);
1374EXPORT_SYMBOL(ivtv_cards_lock);
1364EXPORT_SYMBOL(ivtv_api); 1375EXPORT_SYMBOL(ivtv_api);
1365EXPORT_SYMBOL(ivtv_vapi); 1376EXPORT_SYMBOL(ivtv_vapi);
1366EXPORT_SYMBOL(ivtv_vapi_result); 1377EXPORT_SYMBOL(ivtv_vapi_result);