diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 2e29ab841b4d..7a8f63c4a74c 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -365,9 +365,9 @@ static int mdiobus_create_device(struct mii_bus *bus, */ int __mdiobus_register(struct mii_bus *bus, struct module *owner) { - struct mdio_device *mdiodev; + struct mdio_device *mdiodev = NULL; int i, err; - struct gpio_desc *gpiod; + struct gpio_desc *gpiod = NULL; if (NULL == bus || NULL == bus->name || NULL == bus->read || NULL == bus->write) @@ -410,7 +410,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) for (i = 0; i < PHY_MAX_ADDR; i++) { if ((bus->phy_mask & (1 << i)) == 0) { - struct phy_device *phydev; + struct phy_device *phydev = NULL; phydev = mdiobus_scan(bus, i); if (IS_ERR(phydev) && (PTR_ERR(phydev) != -ENODEV)) { diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index adb66a2fae18..b8fb820d1544 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -576,8 +576,8 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, bool is_c45, struct phy_c45_device_ids *c45_ids) { - struct phy_device *dev; - struct mdio_device *mdiodev; + struct phy_device *dev = NULL; + struct mdio_device *mdiodev = NULL; int ret = 0; /* We allocate the device, and initialize the default values */ @@ -776,7 +776,7 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr, u32 *phy_id, static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, bool is_c45, struct phy_c45_device_ids *c45_ids) { - int phy_reg; + int phy_reg = 0; if (is_c45) return get_phy_c45_ids(bus, addr, phy_id, c45_ids); @@ -834,7 +834,7 @@ EXPORT_SYMBOL(get_phy_device); */ int phy_device_register(struct phy_device *phydev) { - int err; + int err = 0; err = mdiobus_register_device(&phydev->mdio); if (err) diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c index e39f41efda3e..55fee2b6b481 100644 --- a/drivers/net/usb/asix_common.c +++ b/drivers/net/usb/asix_common.c @@ -445,7 +445,7 @@ int asix_mdio_read(struct net_device *netdev, int phy_id, int loc) { struct usbnet *dev = netdev_priv(netdev); __le16 res; - u8 smsr; + u8 smsr = 0; int i = 0; int ret; @@ -478,7 +478,7 @@ void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val) { struct usbnet *dev = netdev_priv(netdev); __le16 res = cpu_to_le16(val); - u8 smsr; + u8 smsr = 0; int i = 0; int ret; @@ -509,7 +509,7 @@ int asix_mdio_read_nopm(struct net_device *netdev, int phy_id, int loc) { struct usbnet *dev = netdev_priv(netdev); __le16 res; - u8 smsr; + u8 smsr = 0; int i = 0; int ret; diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c index 011bd4cb546e..cc9f1356c5d8 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c @@ -183,7 +183,7 @@ static int ax88172a_reset_phy(struct usbnet *dev, int embd_phy) static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) { int ret; - u8 buf[ETH_ALEN]; + u8 buf[ETH_ALEN] = {0}; struct ax88172a_private *priv; usbnet_get_endpoints(dev, intf);