Commit bd78980b authored by Phillip Potter's avatar Phillip Potter Committed by David S. Miller
Browse files

net: usb: ax88179_178a: initialize local variables before use

Use memset to initialize local array in drivers/net/usb/ax88179_178a.c, and
also set a local u16 and u32 variable to 0. Fixes a KMSAN found uninit-value bug
reported by syzbot at:

Signed-off-by: default avatarPhillip Potter <>
Signed-off-by: default avatarDavid S. Miller <>
parent 5a32fcdb
......@@ -296,12 +296,12 @@ static int ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
int ret;
if (2 == size) {
u16 buf;
u16 buf = 0;
ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
*((u16 *)data) = buf;
} else if (4 == size) {
u32 buf;
u32 buf = 0;
ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
*((u32 *)data) = buf;
......@@ -1296,6 +1296,8 @@ static void ax88179_get_mac_addr(struct usbnet *dev)
u8 mac[ETH_ALEN];
memset(mac, 0, sizeof(mac));
/* Maybe the boot loader passed the MAC address via device tree */
if (!eth_platform_get_mac_address(&dev->udev->dev, mac)) {
netif_dbg(dev, ifup, dev->net,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment