[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <64109941-7e88-5a8f-8cda-b552d12e2032@huawei.com>
Date: Wed, 16 Nov 2022 09:01:55 +0800
From: shangxiaojing <shangxiaojing@...wei.com>
To: Tony Nguyen <anthony.l.nguyen@...el.com>,
<jesse.brandeburg@...el.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<jeffrey.t.kirsher@...el.com>, <shannon.nelson@...el.com>,
<intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH] i40e: Fix error handling in i40e_init_module()
On 2022/11/16 3:04, Tony Nguyen wrote:
> On 11/13/2022 5:10 PM, Shang XiaoJing wrote:
>> i40e_init_module() won't free the debugfs directory created by
>> i40e_dbg_init() when pci_register_driver() failed. Add fail path to
>> call i40e_dbg_exit() to remove the debugfs entries to prevent the bug.
>>
>> i40e: Intel(R) Ethernet Connection XL710 Network Driver
>> i40e: Copyright (c) 2013 - 2019 Intel Corporation.
>> debugfs: Directory 'i40e' with parent '/' already present!
>>
>> Fixes: 41c445ff0f48 ("i40e: main driver core")
>> Signed-off-by: Shang XiaoJing <shangxiaojing@...wei.com>
>> ---
>> drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
>> b/drivers/net/ethernet/intel/i40e/i40e_main.c
>> index b5dcd15ced36..828669ea946e 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
>> @@ -16644,6 +16644,8 @@ static struct pci_driver i40e_driver = {
>> **/
>> static int __init i40e_init_module(void)
>> {
>> + int err;
>> +
>> pr_info("%s: %s\n", i40e_driver_name, i40e_driver_string);
>> pr_info("%s: %s\n", i40e_driver_name, i40e_copyright);
>> @@ -16661,7 +16663,13 @@ static int __init i40e_init_module(void)
>> }
>> i40e_dbg_init();
>> - return pci_register_driver(&i40e_driver);
>> + err = pci_register_driver(&i40e_driver);
>> + if (err) {
>> + i40e_dbg_exit();
>
> For fail path, the workqueue needs to be destroyed as well.
Right, will be fixed in v2.
Thanks,
--
Shang XiaoJing
Powered by blists - more mailing lists