From 2e65bafdfd3a8bba972b3d17b6a57816557530fc Mon Sep 17 00:00:00 2001 From: Linmao Li Date: Tue, 21 Jul 2026 10:35:18 +0800 Subject: [PATCH] nfc: nci: free destination parameters when closing a connection 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") Cc: stable@vger.kernel.org Signed-off-by: Linmao Li Reviewed-by: Vadim Fedorenko Link: https://patch.msgid.link/20260721023518.1697625-1-lilinmao@kylinos.cn Signed-off-by: David Heidelberg --- 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 85c3ff2b78cd..b0ab4f5acbce 100644 --- a/net/nfc/nci/rsp.c +++ b/net/nfc/nci/rsp.c @@ -371,6 +371,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); } }