[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240227181709.7159d60f@kernel.org>
Date: Tue, 27 Feb 2024 18:17:09 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Javier Carrasco <javier.carrasco.cruz@...il.com>, Andrew Lunn
<andrew@...n.ch>
Cc: Peter Korsgaard <peter@...sgaard.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, netdev@...r.kernel.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: usb: dm9601: fix wrong return value in
dm9601_mdio_read
On Sun, 25 Feb 2024 00:20:06 +0100 Javier Carrasco wrote:
> The MII code does not check the return value of mdio_read (among
> others), and therefore no error code should be sent. A previous fix to
> the use of an uninitialized variable propagates negative error codes,
> that might lead to wrong operations by the MII library.
>
> An example of such issues is the use of mii_nway_restart by the dm9601
> driver. The mii_nway_restart function does not check the value returned
> by mdio_read, which in this case might be a negative number which could
> contain the exact bit the function checks (BMCR_ANENABLE = 0x1000).
>
> Return zero in case of error, as it is common practice in users of
> mdio_read to avoid wrong uses of the return value.
A bit odd but appears to be true, so I'll apply, thank you!
Andrew,
mii.h files seem to fall under PHYLIB in MAINTAINERS, but mii.c does
not. Is this intentional?
Powered by blists - more mailing lists