Thread (1 message) 1 message, 1 author, 2024-02-27

Re: [PATCH] net: usb: dm9601: fix wrong return value in dm9601_mdio_read

From: Peter Korsgaard <peter@korsgaard.com>
Date: 2024-02-27 16:53:25
Also in: linux-usb, lkml

quoted
quoted
quoted
quoted
"Javier" == Javier Carrasco [off-list ref] writes:
 > 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.

 > Fixes: 8f8abb863fa5 ("net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read")
 > Signed-off-by: Javier Carrasco [off-list ref]

Reviewed-by: Peter Korsgaard <peter@korsgaard.com>

-- 
Bye, Peter Korsgaard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help