From: Leon Romanovsky <leon@kernel.org>
To: Zhang Changzhong <zhangchangzhong@huawei.com>
Cc: GR-Linux-NIC-Dev@marvell.com,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Jeff Garzik <jeff@garzik.org>, Ron Mercer <ron.mercer@qlogic.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net/qla3xxx: fix potential memleak in ql3xxx_send()
Date: Thu, 17 Nov 2022 13:38:33 +0200 [thread overview]
Message-ID: <Y3YdOQYQ5SjdeRpT@unreal> (raw)
In-Reply-To: <1668675039-21138-1-git-send-email-zhangchangzhong@huawei.com>
On Thu, Nov 17, 2022 at 04:50:38PM +0800, Zhang Changzhong wrote:
> The ql3xxx_send() returns NETDEV_TX_OK without freeing skb in error
> handling case, add dev_kfree_skb_any() to fix it.
Can you please remind me why should it release?
There are no paths in ql3xxx_send() that release skb.
Thanks
>
> Fixes: bd36b0ac5d06 ("qla3xxx: Add support for Qlogic 4032 chip.")
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> ---
> drivers/net/ethernet/qlogic/qla3xxx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
> index 76072f8..0d57ffc 100644
> --- a/drivers/net/ethernet/qlogic/qla3xxx.c
> +++ b/drivers/net/ethernet/qlogic/qla3xxx.c
> @@ -2471,6 +2471,7 @@ static netdev_tx_t ql3xxx_send(struct sk_buff *skb,
> skb_shinfo(skb)->nr_frags);
> if (tx_cb->seg_count == -1) {
> netdev_err(ndev, "%s: invalid segment count!\n", __func__);
> + dev_kfree_skb_any(skb);
> return NETDEV_TX_OK;
> }
>
> --
> 2.9.5
>
next prev parent reply other threads:[~2022-11-17 11:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 8:50 [PATCH net] net/qla3xxx: fix potential memleak in ql3xxx_send() Zhang Changzhong
2022-11-17 11:38 ` Leon Romanovsky [this message]
2022-11-17 12:14 ` Zhang Changzhong
2022-11-19 3:50 ` patchwork-bot+netdevbpf
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=Y3YdOQYQ5SjdeRpT@unreal \
--to=leon@kernel.org \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jeff@garzik.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ron.mercer@qlogic.com \
--cc=zhangchangzhong@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).