From: Jakub Kicinski <kuba@kernel.org>
To: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: <bongsu.jeon@samsung.com>, <krzysztof.kozlowski@linaro.org>,
<pabeni@redhat.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH v2] nfc: virtual_ncidev: Fix memory leak in virtual_nci_send()
Date: Wed, 19 Oct 2022 17:33:51 -0700 [thread overview]
Message-ID: <20221019173351.4e3a8ab7@kernel.org> (raw)
In-Reply-To: <20221018114935.8871-1-shangxiaojing@huawei.com>
On Tue, 18 Oct 2022 19:49:35 +0800 Shang XiaoJing wrote:
> --- a/drivers/nfc/virtual_ncidev.c
> +++ b/drivers/nfc/virtual_ncidev.c
> @@ -54,16 +54,19 @@ static int virtual_nci_send(struct nci_dev *ndev, struct sk_buff *skb)
> mutex_lock(&nci_mutex);
> if (state != virtual_ncidev_enabled) {
> mutex_unlock(&nci_mutex);
> + consume_skb(skb);
> return 0;
> }
>
> if (send_buff) {
> mutex_unlock(&nci_mutex);
> + consume_skb(skb);
> return -1;
these two should be kfree_skb() as we're dropping a packet
next prev parent reply other threads:[~2022-10-20 0:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 11:49 [PATCH v2] nfc: virtual_ncidev: Fix memory leak in virtual_nci_send() Shang XiaoJing
2022-10-18 14:06 ` Krzysztof Kozlowski
2022-10-19 1:29 ` shangxiaojing
2022-10-20 0:33 ` Jakub Kicinski [this message]
2022-10-20 0:59 ` shangxiaojing
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=20221019173351.4e3a8ab7@kernel.org \
--to=kuba@kernel.org \
--cc=bongsu.jeon@samsung.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shangxiaojing@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).