nfc: fdp: Fix potential memory leak in fdp_nci_send()
authorShang XiaoJing <shangxiaojing@huawei.com>
Thu, 27 Oct 2022 14:03:29 +0000 (22:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 17:14:17 +0000 (18:14 +0100)
commite8c11ee2d07f7c4dfa2ac0ea8efc4f627e58ea57
tree702776f12bb4687e7000e1e32c9b76fb26ef0d14
parent31b83d6990c8e5fe8600f4553bbe8beb2b249a56
nfc: fdp: Fix potential memory leak in fdp_nci_send()

[ Upstream commit 8e4aae6b8ca76afb1fb64dcb24be44ba814e7f8a ]

fdp_nci_send() will call fdp_nci_i2c_write that will not free skb in
the function. As a result, when fdp_nci_i2c_write() finished, the skb
will memleak. fdp_nci_send() should free skb after fdp_nci_i2c_write()
finished.

Fixes: a06347c04c13 ("NFC: Add Intel Fields Peak NFC solution driver")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nfc/fdp/fdp.c