]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:16 +0000 (11:40 +0200)
commit4ee0b5f7c219a78b2307e9081e95857479371d59
treefc32ed4eabd859b162abe80bbb3adba8eec9e9a2
parent619b9db543da2f9fe693baf2fc90b181ecd72959
NFC: digital: fix possible memory leak in digital_tg_listen_mdaa()

commit 58e7dcc9ca29c14e44267a4d0ea61e3229124907 upstream.

'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: 846f590d9c5f ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/nfc/digital_core.c