From 1c134c659904809d1ca3baf2bb295ca1c7107aee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 8 May 2024 19:45:37 +0200 Subject: Merging upstream version 5.10.216. Signed-off-by: Daniel Baumann --- net/nfc/nci/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'net/nfc/nci/core.c') diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 4c931bd1c..d8002065b 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -1197,6 +1197,10 @@ void nci_free_device(struct nci_dev *ndev) { nfc_free_device(ndev->nfc_dev); nci_hci_deallocate(ndev); + + /* drop partial rx data packet if present */ + if (ndev->rx_data_reassembly) + kfree_skb(ndev->rx_data_reassembly); kfree(ndev); } EXPORT_SYMBOL(nci_free_device); @@ -1498,6 +1502,11 @@ static void nci_rx_work(struct work_struct *work) nfc_send_to_raw_sock(ndev->nfc_dev, skb, RAW_PAYLOAD_NCI, NFC_DIRECTION_RX); + if (!nci_plen(skb->data)) { + kfree_skb(skb); + break; + } + /* Process frame */ switch (nci_mt(skb->data)) { case NCI_MT_RSP_PKT: -- cgit v1.2.3