[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1013af1d-51f7-9798-e2aa-15c03d269ac1@canonical.com>
Date: Wed, 13 Oct 2021 11:35:03 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
To: Ziyang Xuan <william.xuanziyang@...wei.com>
Cc: davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 1/2] NFC: digital: fix possible memory leak in
digital_tg_listen_mdaa()
On 13/10/2021 09:50, Ziyang Xuan wrote:
> '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@...wei.com>
> ---
> net/nfc/digital_core.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
Good catch. Leak is only theoretical as digital_send_cmd() will fail
only on memory allocation failure but your fix makes code correct.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Best regards,
Krzysztof
Powered by blists - more mailing lists