From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Linmao Li <lilinmao@kylinos.cn>, David Heidelberg <david@ixit.cz>,
Jakub Kicinski <kuba@kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
oe-linux-nfc@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] nfc: nci: free destination parameters when closing a connection
Date: Tue, 21 Jul 2026 10:47:55 +0100 [thread overview]
Message-ID: <882f9018-30bc-41b9-ad18-1952ecf8c113@linux.dev> (raw)
In-Reply-To: <20260721023518.1697625-1-lilinmao@kylinos.cn>
On 21/07/2026 03:35, Linmao Li wrote:
> When a connection is closed, nci_core_conn_close_rsp_packet() frees
> conn_info but not conn_info->dest_params, which is a separate devm
> allocation. Each connect/close cycle leaks one dest_params until the
> NFC device is removed. Free dest_params along with conn_info.
>
> Fixes: 9b8d1a4cf2aa ("nfc: nci: Add an additional parameter to identify a connection id")
> Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
> ---
> net/nfc/nci/rsp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
> index 6b2fa6bdbd14..21c2fe64490e 100644
> --- a/net/nfc/nci/rsp.c
> +++ b/net/nfc/nci/rsp.c
> @@ -360,6 +360,7 @@ static void nci_core_conn_close_rsp_packet(struct nci_dev *ndev,
> list_del(&conn_info->list);
> if (conn_info == ndev->rf_conn_info)
> ndev->rf_conn_info = NULL;
> + devm_kfree(&ndev->nfc_dev->dev, conn_info->dest_params);
> devm_kfree(&ndev->nfc_dev->dev, conn_info);
> }
> }
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
prev parent reply other threads:[~2026-07-21 9:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 2:35 [PATCH net] nfc: nci: free destination parameters when closing a connection Linmao Li
2026-07-21 9:47 ` Vadim Fedorenko [this message]
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=882f9018-30bc-41b9-ad18-1952ecf8c113@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=davem@davemloft.net \
--cc=david@ixit.cz \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=lilinmao@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=pabeni@redhat.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