[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221019173351.4e3a8ab7@kernel.org>
Date: Wed, 19 Oct 2022 17:33:51 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Shang XiaoJing <shangxiaojing@...wei.com>
Cc: <bongsu.jeon@...sung.com>, <krzysztof.kozlowski@...aro.org>,
<pabeni@...hat.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH v2] nfc: virtual_ncidev: Fix memory leak in
virtual_nci_send()
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
Powered by blists - more mailing lists