From: Leon Romanovsky <leon@kernel.org>
To: Yuan Can <yuancan@huawei.com>
Cc: shshaikh@marvell.com, manishc@marvell.com,
GR-Linux-NIC-Dev@marvell.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
sucheta.chakraborty@qlogic.com, rajesh.borundia@qlogic.com,
netdev@vger.kernel.org
Subject: Re: [PATCH net] drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
Date: Wed, 7 Dec 2022 09:56:44 +0200 [thread overview]
Message-ID: <Y5BHPCE5rfQ0cmne@unreal> (raw)
In-Reply-To: <20221206103031.20609-1-yuancan@huawei.com>
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@huawei.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);
Thanks
>
> qlcnic_destroy_trans_wq:
> destroy_workqueue(bc->bc_trans_wq);
> --
> 2.17.1
>
next prev parent reply other threads:[~2022-12-07 7:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 10:30 [PATCH net] drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init() Yuan Can
2022-12-07 7:56 ` Leon Romanovsky [this message]
2022-12-07 8:56 ` Yuan Can
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5BHPCE5rfQ0cmne@unreal \
--to=leon@kernel.org \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rajesh.borundia@qlogic.com \
--cc=shshaikh@marvell.com \
--cc=sucheta.chakraborty@qlogic.com \
--cc=yuancan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.