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

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

Fixes: 1c7a4c24fbfd ("NFC Digital: Add target NFC-DEP 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_core.c