Re: KMSAN: uninit-value in mii_nway_restart

syzbot
2024-09-07T11:09:29Z

> diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
> index 48d7d278631e..2e2bb22e60ea 100644
> --- a/drivers/net/usb/dm9601.c
> +++ b/drivers/net/usb/dm9601.c
> @@ -10,6 +10,7 @@
>
> //#define DEBUG
>
> +#include "net/net_debug.h"
> #include <linux/module.h>
> #include <linux/sched.h>
> #include <linux/stddef.h>
> @@ -222,13 +223,18 @@ static int dm9601_mdio_read(struct net_device
> *netdev, int phy_id, int loc)
> struct usbnet *dev = netdev_priv(netdev);
>
> __le16 res;
> + int err;
>
> if (phy_id) {
> netdev_dbg(dev->net, "Only internal phy supported\n");
> return 0;
> }
>
> - dm_read_shared_word(dev, 1, loc, &res);
> + err = dm_read_shared_word(dev, 1, loc, &res);
> + if (err < 0) {
> + netdev_err(dev->net, "MDIO read error: %d\n", err);
> + return err;
> + }
>
> netdev_dbg(dev->net,
> "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",