Skip to contentSkip to conversation

NFC: st21nfca: add missed kfree_skb() in an error path

PATCH In review Chuhong Yuan 2 participants 2 messages May 28, 2020 – May 30, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFC: st21nfca: add missed kfree_skb() in an error path

st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path. Add the missed function call to fix it.

Fixes 1892bf844ea0 ("NFC: st21nfca: Adding P2P support to st21nfca in Initiator & Target mode")
---
 drivers/nfc/st21nfca/dep.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nfc/st21nfca/dep.c +3 -1
index a1d69f9b2d4a..0b9ca6d20ffa 100644
@@ -173,8 +173,10 @@ static int st21nfca_tm_send_atr_res(struct nfc_hci_dev *hdev,
 		memcpy(atr_res->gbi, atr_req->gbi, gb_len);
 		r = nfc_set_remote_general_bytes(hdev->ndev, atr_res->gbi,
 						  gb_len);
-		if (r < 0)
+		if (r < 0) {
+			kfree_skb(skb);
 			return r;
+		}
 	}
 
 	info->dep_info.curr_nfc_dep_pni = 0;
Signature · 1 line
2.26.2
maintainer
#1 lore raw

From: Chuhong Yuan <[email protected]>
Date: Thu, 28 May 2020 18:20:37 +0800

Quoted 5 lines

st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path. Add the missed function call to fix it.

Fixes 1892bf844ea0 ("NFC: st21nfca: Adding P2P support to st21nfca in Initiator & Target mode")

Applied and queued up for -stable, thank you.