[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZGIaOYaSTDUqUrAB@corigine.com>
Date: Mon, 15 May 2023 13:40:41 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Thierry Escande <thierry.escande@...labora.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nfx: llcp: fix possible use of uninitialized variable in
nfc_llcp_send_connect()
On Sun, May 14, 2023 at 11:15:40AM +0200, Krzysztof Kozlowski wrote:
> On 14/05/2023 10:29, Simon Horman wrote:
> > 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.
>
> They were not ordered in the first place, so you prefer me to re-shuffle
> all of them (a bit independent change)?
My slight preference is to move them towards being ordered.
Maybe that is not practical in this case.
As you point out, they are currently out of order.
And if you think re-shuffling can be done, without excess churn,
I think that would be fine.
Given the current state of the code, reverse xmas tree is much more of a
suggestion than a requirement form my side.
Powered by blists - more mailing lists