[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2vpyGB+iivl0L+K@electric-eye.fr.zoreil.com>
Date: Wed, 9 Nov 2022 18:56:24 +0100
From: Francois Romieu <romieu@...zoreil.com>
To: Yuan Can <yuancan@...wei.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, mqaio@...ux.alibaba.com,
shaozhengchao@...wei.com, christophe.jaillet@...adoo.fr,
gustavoars@...nel.org, luobin9@...wei.com, netdev@...r.kernel.org
Subject: Re: [PATCH] net: hinic: Fix error handling in hinic_module_init()
Yuan Can <yuancan@...wei.com> :
[...]
> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
> index e1f54a2f28b2..b2fcd83d58fa 100644
> --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
> +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
> @@ -1474,8 +1474,17 @@ static struct pci_driver hinic_driver = {
>
> static int __init hinic_module_init(void)
> {
> + int ret;
> +
> hinic_dbg_register_debugfs(HINIC_DRV_NAME);
> - return pci_register_driver(&hinic_driver);
> +
> + ret = pci_register_driver(&hinic_driver);
> + if (ret) {
> + hinic_dbg_unregister_debugfs();
> + return ret;
> + }
> +
> + return 0;
> }
You can remove some fat:
ret = pci_register_driver(&hinic_driver);
if (ret)
hinic_dbg_unregister_debugfs();
return ret;
--
Ueimor
Powered by blists - more mailing lists