mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
staging: gpib: cec: Handle gpib_register_driver() errors
The function gpib_register_driver() can fail and result in a semi-registered module and does not return an error value if it fails. Unregister the pci registering function in case gpib_register_driver() fails and return the error value. Add pr_err() statements indicating the fail and also the error value. Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com> Link: https://lore.kernel.org/r/20241230185633.175690-6-niharchaithanya@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
65aff9b75b
commit
f07296bc75
|
|
@ -365,11 +365,15 @@ static int __init cec_init_module(void)
|
|||
|
||||
result = pci_register_driver(&cec_pci_driver);
|
||||
if (result) {
|
||||
pr_err("cec_gpib: pci_driver_register failed!\n");
|
||||
pr_err("cec_gpib: pci_register_driver failed: error = %d\n", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
gpib_register_driver(&cec_pci_interface, THIS_MODULE);
|
||||
result = gpib_register_driver(&cec_pci_interface, THIS_MODULE);
|
||||
if (result) {
|
||||
pr_err("cec_gpib: gpib_register_driver failed: error = %d\n", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user