Skip to content

Commit

Permalink
net: defxx: Fix missing err handling in dfx_init()
Browse files Browse the repository at this point in the history
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().

Fixes: e89a2cf ("[TC] defxx: TURBOchannel support")
Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yongqiang Liu authored and David S. Miller committed Dec 9, 2022
1 parent 44aa5a6 commit ae18dcd
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions drivers/net/fddi/defxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ae18dcd

Please sign in to comment.