]> git.baikalelectronics.ru Git - kernel.git/commit
NFC: digital: fix possible memory leak in digital_in_send_sdd_req()
authorZiyang Xuan <william.xuanziyang@huawei.com>
Wed, 13 Oct 2021 07:50:32 +0000 (15:50 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 Oct 2021 00:44:29 +0000 (17:44 -0700)
commit291c932fc3692e4d211a445ba8aa35663831bac7
tree1178e0802a707fcadd60aedfee8327c20b31ece5
parent58e7dcc9ca29c14e44267a4d0ea61e3229124907
NFC: digital: fix possible memory leak in digital_in_send_sdd_req()

'skb' is allocated in digital_in_send_sdd_req(), but not free when
digital_in_send_cmd() failed, which will cause memory leak. Fix it
by freeing 'skb' if digital_in_send_cmd() return failed.

Fixes: 2c66daecc409 ("NFC Digital: Add NFC-A technology support")
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/nfc/digital_technology.c