Re: [PATCH] nfx: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()

From: Simon Horman
Date: Sun May 14 2023 - 04:29:33 EST


On Sat, May 13, 2023 at 01:51:12PM +0200, Krzysztof Kozlowski wrote:
> On 13/05/2023 13:49, Krzysztof Kozlowski wrote:
> > If sock->service_name is NULL, the local variable
> > service_name_tlv_length will not be assigned by nfc_llcp_build_tlv(),
> > later leading to using value frmo the stack. Smatch warning:
> >
> > net/nfc/llcp_commands.c:442 nfc_llcp_send_connect() error: uninitialized symbol 'service_name_tlv_length'.
>
> Eh, typo in subject prefix. V2 in shortly...

Also, s/frmo/from/

And please consider moving local variables towards reverse xmas tree -
longest line to shortest - order for networking code.