[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220305203253.jso2wergnn5c7fsx@skbuf>
Date: Sat, 5 Mar 2022 22:32:53 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: trix@...hat.com
Cc: andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
davem@...emloft.net, kuba@...nel.org, nathan@...nel.org,
ndesaulniers@...gle.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] net: dsa: return success if there was nothing to do
On Sat, Mar 05, 2022 at 09:14:48AM -0800, trix@...hat.com wrote:
> From: Tom Rix <trix@...hat.com>
>
> Clang static analysis reports this representative issue
> dsa.c:486:2: warning: Undefined or garbage value
> returned to caller
> return err;
> ^~~~~~~~~~
>
> err is only set in the loop. If the loop is empty,
> garbage will be returned. So initialize err to 0
> to handle this noop case.
>
> Signed-off-by: Tom Rix <trix@...hat.com>
> ---
Reviewed-by: Vladimir Oltean <olteanv@...il.com>
Powered by blists - more mailing lists