Patch "net: usb: dm9601: fix wrong return value in dm9601_mdio_read" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: usb: dm9601: fix wrong return value in dm9601_mdio_read

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-usb-dm9601-fix-wrong-return-value-in-dm9601_mdio.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 07a2d624ff2c54511c92e6d2a8440348a4b97921
Author: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
Date:   Sun Feb 25 00:20:06 2024 +0100

    net: usb: dm9601: fix wrong return value in dm9601_mdio_read
    
    [ Upstream commit c68b2c9eba38ec3f60f4894b189090febf4d8d22 ]
    
    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 <javier.carrasco.cruz@xxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Reviewed-by: Peter Korsgaard <peter@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240225-dm9601_ret_err-v1-1-02c1d959ea59@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index 1959e12a3ff8a..f7357d884d6aa 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -232,7 +232,7 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc)
 	err = dm_read_shared_word(dev, 1, loc, &res);
 	if (err < 0) {
 		netdev_err(dev->net, "MDIO read error: %d\n", err);
-		return err;
+		return 0;
 	}
 
 	netdev_dbg(dev->net,




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux