Thread (2 messages) 2 messages, 2 authors, 7d ago

Re: [PATCH net] nfc: nci: free destination parameters when closing a connection

From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date: 2026-07-21 09:48:32
Also in: lkml, oe-linux-nfc

On 21/07/2026 03:35, Linmao Li wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
---
  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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help