* [PATCH net] net: defxx: Fix missing err handling in dfx_init()
@ 2022-12-07 7:20 Yongqiang Liu
2022-12-07 13:57 ` Jiri Pirko
2022-12-09 10:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Yongqiang Liu @ 2022-12-07 7:20 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: macro, davem, edumazet, kuba, pabeni, ralf, jeff, akpm,
liuyongqiang13, zhangxiaoxu5
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: e89a2cfb7d7b5 ("[TC] defxx: TURBOchannel support")
Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com>
---
drivers/net/fddi/defxx.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index b584ffe38ad6..1fef8a9b1a0f 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -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;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: defxx: Fix missing err handling in dfx_init()
2022-12-07 7:20 [PATCH net] net: defxx: Fix missing err handling in dfx_init() Yongqiang Liu
@ 2022-12-07 13:57 ` Jiri Pirko
2022-12-09 15:23 ` Maciej W. Rozycki
2022-12-09 10:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2022-12-07 13:57 UTC (permalink / raw)
To: Yongqiang Liu
Cc: netdev, linux-kernel, macro, davem, edumazet, kuba, pabeni, ralf,
jeff, akpm, zhangxiaoxu5
Wed, Dec 07, 2022 at 08:20:45AM CET, liuyongqiang13@huawei.com wrote:
>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: e89a2cfb7d7b5 ("[TC] defxx: TURBOchannel support")
>Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: defxx: Fix missing err handling in dfx_init()
2022-12-07 7:20 [PATCH net] net: defxx: Fix missing err handling in dfx_init() Yongqiang Liu
2022-12-07 13:57 ` Jiri Pirko
@ 2022-12-09 10:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-09 10:50 UTC (permalink / raw)
To: Yongqiang Liu
Cc: netdev, linux-kernel, macro, davem, edumazet, kuba, pabeni, ralf,
jeff, akpm, zhangxiaoxu5
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Wed, 7 Dec 2022 07:20:45 +0000 you wrote:
> 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().
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: defxx: Fix missing err handling in dfx_init()
2022-12-07 13:57 ` Jiri Pirko
@ 2022-12-09 15:23 ` Maciej W. Rozycki
0 siblings, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2022-12-09 15:23 UTC (permalink / raw)
To: Jiri Pirko
Cc: Yongqiang Liu, netdev, linux-kernel, David S. Miller, edumazet,
kuba, pabeni, Ralf Baechle, jeff, Andrew Morton, zhangxiaoxu5
On Wed, 7 Dec 2022, Jiri Pirko wrote:
> >Fixes: e89a2cfb7d7b5 ("[TC] defxx: TURBOchannel support")
> >Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com>
>
> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
I only got at this change now. Thank you both for taking care of this
issue.
Acked-by: Maciej W. Rozycki <macro@orcam.me.uk>
Maciej
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-09 15:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-07 7:20 [PATCH net] net: defxx: Fix missing err handling in dfx_init() Yongqiang Liu
2022-12-07 13:57 ` Jiri Pirko
2022-12-09 15:23 ` Maciej W. Rozycki
2022-12-09 10:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).