[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9f5eeae-6785-5fb8-06a4-3d846e8658c9@huawei.com>
Date: Tue, 6 Dec 2022 18:28:26 +0800
From: Yuan Can <yuancan@...wei.com>
To: Leon Romanovsky <leon@...nel.org>
CC: <jesse.brandeburg@...el.com>, <anthony.l.nguyen@...el.com>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <jeffrey.t.kirsher@...el.com>,
<alice.michael@...el.com>, <piotr.marczak@...el.com>,
<intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH] intel/i40e: Fix potential memory leak in
i40e_init_recovery_mode()
在 2022/12/6 18:02, Leon Romanovsky 写道:
> On Tue, Dec 06, 2022 at 09:26:13AM +0000, Yuan Can wrote:
>> If i40e_vsi_mem_alloc() failed in i40e_init_recovery_mode(), the pf will be
>> freed with the pf->vsi leaked.
>> Fix by free pf->vsi in the error handling path.
>>
>> Fixes: 4ff0ee1af016 ("i40e: Introduce recovery mode support")
>> Signed-off-by: Yuan Can <yuancan@...wei.com>
>> ---
>> drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
>> 1 file changed, 1 insertion(+)
> The patch title needs to be "[PATCH net]..."
>
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
>> index b5dcd15ced36..d23081c224d6 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
>> @@ -15536,6 +15536,7 @@ static int i40e_init_recovery_mode(struct i40e_pf *pf, struct i40e_hw *hw)
>> pci_disable_pcie_error_reporting(pf->pdev);
>> pci_release_mem_regions(pf->pdev);
>> pci_disable_device(pf->pdev);
>> + kfree(pf->vsi);
>> kfree(pf);
>>
>> return err;
> The change is ok, but it is worth to cleanup error flow of i40e_probe and i40e_remove
> as they are not really in the same order.
>
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@...dia.com>
Thanks for the review, the title problem will be fixed in the next version.
--
Best regards,
Yuan Can
Powered by blists - more mailing lists