Re: [PATCH RESEND] nfc: hci: Save a few bytes of memory when registering a 'nfc_llc' engine
From: Jakub Kicinski
Date: Wed Jan 31 2024 - 18:26:23 EST
On Sat, 27 Jan 2024 10:58:29 +0100 Christophe JAILLET wrote:
> nfc_llc_register() calls pass a string literal as the 'name' parameter.
>
> So kstrdup_const() can be used instead of kfree() to avoid a memory
> allocation in such cases.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
There is a kfree() call in nfc_llc_exit() that looks suspiciously
like it may also free the name.