Re: [PATCH] nfc: llcp: fix sdreq TLV list leak on parse/alloc/send failure
From: Simon Horman
Date: Thu Sep 17 2026 - 04:48:06 EST
On Mon, Sep 14, 2026 at 07:11:29PM +0700, Cong Nguyen wrote:
> nfc_genl_llc_sdreq() builds a list of TLV nodes while walking nested
> netlink attrs, but 3 error paths (nested-attr parse failure, TLV alloc
> ENOMEM, nfc_llcp_send_snl_sdreq() failure) all skip freeing what was
> already queued.
>
> Route them through a new free_list label, mirroring the SDRES path in
> the same file which already does this. Harmless on the success path
> too -- send_snl_sdreq() drains the list as it moves nodes, so it's
> already empty by the time free_list runs.
>
> Fixes: d9b8d8e19b07 ("NFC: llcp: Service Name Lookup netlink interface")
> Assisted-by: Claude:claude-opus-4
> Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>