Re: [PATCH] net: dsa: vsc73xxx: Fix uninitalized 'val' in vsc73xx_adjust_link

From: Vladimir Oltean
Date: Mon Mar 13 2023 - 19:05:34 EST


On Mon, Mar 13, 2023 at 07:59:27PM +0100, Simon Horman wrote:
> On Sun, Mar 12, 2023 at 03:50:08PM +0000, Danila Chernetsov wrote:
> > Using uninitialized variable after calls vsc73xx_read
> > without error checking may cause incorrect driver behavior.
>
> I wonder if it is:
> a) intentional that these calls are not checked for errors

probably no; this is precisely the only vsc73xx_read() call whose return
code is ignores. I'd say it partly has to do with the fact that vsc73xx_adjust_link()
returns void, so the author was thinking there'd be no point in checking
for errors, but there clearly is

> b) errors can occur in these call paths

probably yes; one of the instantiations of vsc73xx is over SPI, where
the controller can time out, etc.