Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99a8efbb authored by Pan Bian's avatar Pan Bian Committed by David S. Miller
Browse files

NFC: st21nfca: fix double free



The variable nfcid_skb is not changed in the callee nfc_hci_get_param()
if error occurs. Consequently, the freed variable nfcid_skb will be
freed again, resulting in a double free bug. Set nfcid_skb to NULL after
releasing it to fix the bug.

Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 648db051
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -708,6 +708,7 @@ static int st21nfca_hci_complete_target_discovered(struct nfc_hci_dev *hdev,
							NFC_PROTO_FELICA_MASK;
		} else {
			kfree_skb(nfcid_skb);
			nfcid_skb = NULL;
			/* P2P in type A */
			r = nfc_hci_get_param(hdev, ST21NFCA_RF_READER_F_GATE,
					ST21NFCA_RF_READER_F_NFCID1,