]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: nfcmrvl: Fix potential memory leak in nfcmrvl_i2c_nci_send()
authorShang XiaoJing <shangxiaojing@huawei.com>
Thu, 17 Nov 2022 11:37:12 +0000 (19:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Nov 2022 08:31:52 +0000 (08:31 +0000)
commit4b4de4a471e10bf0d87a1914b59a1164a2fa0cce
treeaa6f4bee97031b1705359778b4303a1e9c8d7c1b
parent4f0299ce1cd0a4d5f0f728a89a38b6e9421f28f0
nfc: nfcmrvl: Fix potential memory leak in nfcmrvl_i2c_nci_send()

nfcmrvl_i2c_nci_send() will be called by nfcmrvl_nci_send(), and skb
should be freed in nfcmrvl_i2c_nci_send(). However, nfcmrvl_nci_send()
won't free the skb when it failed for the test_bit(). Free the skb when
test_bit() failed.

Fixes: faf2f4e38ac0 ("NFC: nfcmrvl: add i2c driver")
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/nfcmrvl/i2c.c