nfc: nxp-nci: Fix potential memory leak in nxp_nci_send()
authorShang XiaoJing <shangxiaojing@huawei.com>
Thu, 17 Nov 2022 11:37:13 +0000 (19:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Nov 2022 08:31:53 +0000 (08:31 +0000)
commit614761e1119c994a7f19e4c9f37b1d2d7fe7306e
tree99694089e5ca72411e50efc3aafcf58c89672407
parente204ead35401af5e120f653a133d54ee2595627e
nfc: nxp-nci: Fix potential memory leak in nxp_nci_send()

nxp_nci_send() won't free the skb when it failed for the check before
write(). As the result, the skb will memleak. Free the skb when the
check failed.

Fixes: dece45855a8b ("NFC: nxp-nci: Add support for NXP NCI chips")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Suggested-by: Pavel Machek <pavel@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/nfc/nxp-nci/core.c