lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <14a8bcdc-6ef6-f29c-8dab-83f48b93ed9d@huawei.com>
Date:   Wed, 7 Dec 2022 16:56:25 +0800
From:   Yuan Can <yuancan@...wei.com>
To:     Leon Romanovsky <leon@...nel.org>
CC:     <shshaikh@...vell.com>, <manishc@...vell.com>,
        <GR-Linux-NIC-Dev@...vell.com>, <davem@...emloft.net>,
        <edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
        <sucheta.chakraborty@...gic.com>, <rajesh.borundia@...gic.com>,
        <netdev@...r.kernel.org>
Subject: Re: [PATCH net] drivers: net: qlcnic: Fix potential memory leak in
 qlcnic_sriov_init()


在 2022/12/7 15:56, Leon Romanovsky 写道:
> On Tue, Dec 06, 2022 at 10:30:31AM +0000, Yuan Can wrote:
>> If vp alloc failed in qlcnic_sriov_init(), all previously allocated vp
>> needs to be freed.
>>
>> Fixes: f197a7aa6288 ("qlcnic: VF-PF communication channel implementation")
>> Signed-off-by: Yuan Can <yuancan@...wei.com>
>> ---
>>   drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
>> index 9282321c2e7f..d0470c62e1b2 100644
>> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
>> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
>> @@ -222,6 +222,8 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs)
>>   
>>   qlcnic_destroy_async_wq:
>>   	destroy_workqueue(bc->bc_async_wq);
>> +	while (i--)
>> +		kfree(sriov->vf_info[i].vp);
> These lines should be before destroy_workqueue(bc->bc_async_wq);
Ok, thanks for the review!

-- 
Best regards,
Yuan Can

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ