summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-12-17 15:26:29 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-12-17 15:26:29 -0200
commitbb76d5869181e4c5eb84019976eed7c2c6fc0171 (patch)
tree2d4323c8490cd5470f03da2d98d8cff2651a7b3f
parentec5990962919f8527a8dedcf3d0f7f2eae52e1db (diff)
downloadmediapointer-dvb-s2-bb76d5869181e4c5eb84019976eed7c2c6fc0171.tar.gz
mediapointer-dvb-s2-bb76d5869181e4c5eb84019976eed7c2c6fc0171.tar.bz2
bttv: check pci_register_driver() error
From: Akinobu Mita <akinobu.mita@gmail.com> Check pci_register_driver() error in module_init. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c
index 3efc9465b..494afcbe6 100644
--- a/linux/drivers/media/video/bt8xx/bttv-driver.c
+++ b/linux/drivers/media/video/bt8xx/bttv-driver.c
@@ -4481,7 +4481,11 @@ static int __init bttv_init_module(void)
return ret;
}
#endif
- return pci_register_driver(&bttv_pci_driver);
+ ret = pci_register_driver(&bttv_pci_driver);
+ if (ret < 0)
+ bus_unregister(&bttv_sub_bus_type);
+
+ return ret;
}
static void __exit bttv_cleanup_module(void)
@@ -4490,7 +4494,6 @@ static void __exit bttv_cleanup_module(void)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
bus_unregister(&bttv_sub_bus_type);
#endif
- return;
}
module_init(bttv_init_module);