net: defxx: Fix missing err handling in dfx_init()
Subsystems (3)
PATCH 1/1 net: defxx: Fix missing err handling in dfx_init()
When eisa_driver_register() or tc_register_driver() failed, the modprobe defxx would fail with some err log as follows:
Error: Driver 'defxx' is already registered, aborting...
Fix this issue by adding err hanling in dfx_init().
--- drivers/net/fddi/defxx.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/net/fddi/defxx.c +18 -4
@@ -3831,10 +3831,24 @@ static int dfx_init(void)int status; status =pci_register_driver (&dfx_pci_driver); -if (!status) - status =eisa_driver_register (&dfx_eisa_driver); -if (!status) - status =tc_register_driver (&dfx_tc_driver); +if (status) + goto err_pci_register; + + status =eisa_driver_register (&dfx_eisa_driver); +if (status) + goto err_eisa_register; + + status =tc_register_driver (&dfx_tc_driver); +if (status) + goto err_tc_register; + +return 0 ; + +err_tc_register: +eisa_driver_unregister (&dfx_eisa_driver); +err_eisa_register: +pci_unregister_driver (&dfx_pci_driver); +err_pci_register:return status; }
Signature · 1 line
2.25.1
Quoted 9 lines · Wed, Dec 07, 2022 at 08:20:45AM CET, [email protected] wrote:
When
eisa_driver_register()ortc_register_driver()failed, the modprobe defxx would fail with some err log as follows:Error: Driver 'defxx' is already registered, aborting...
Fix this issue by adding err hanling in
dfx_init().Fixes e89a2cfb7d7b5 ("[TC] defxx: TURBOchannel support")Signed-off-by Yongqiang Liu <[email protected]>
Quoted 4 lines · Jiri Pirko
Quoted 2 lines
Fixes e89a2cfb7d7b5 ("[TC] defxx: TURBOchannel support")Signed-off-by Yongqiang Liu <[email protected]>Reviewed-by Jiri Pirko <[email protected]>
I only got at this change now. Thank you both for taking care of this
issue.
Maciej
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Wed, 7 Dec 2022 07:20:45 +0000 you wrote:
When
eisa_driver_register()ortc_register_driver()failed, the modprobe defxx would fail with some err log as follows:Error: Driver 'defxx' is already registered, aborting...
Fix this issue by adding err hanling in
dfx_init().[...]
Here is the summary with links:
- [net] net: defxx: Fix missing err handling in dfx_init()
https://git.kernel.org/netdev/net/c/ae18dcdff0f8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html