Commit 9e7e85eb authored by Akinobu Mita's avatar Akinobu Mita Committed by Mauro Carvalho Chehab

V4L/DVB (6848): bttv: check pci_register_driver() error

Check pci_register_driver() error in module_init.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 71021d26
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment