From: Akinobu Mita Date: Mon, 17 Dec 2007 17:26:29 +0000 (-0300) Subject: V4L/DVB (6848): bttv: check pci_register_driver() error X-Git-Tag: v2.6.25-rc1~1235^2~174 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e7e85ebaeba22979209268423f5aae8a352df4c;p=linux-2.6 V4L/DVB (6848): bttv: check pci_register_driver() error Check pci_register_driver() error in module_init. Signed-off-by: Akinobu Mita Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index eb2c12eb2f..e04113f0b7 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -4404,14 +4404,17 @@ static int __init bttv_init_module(void) printk(KERN_WARNING "bttv: bus_register error: %d\n", ret); return ret; } - 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) { pci_unregister_driver(&bttv_pci_driver); bus_unregister(&bttv_sub_bus_type); - return; } module_init(bttv_init_module);