diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-21 15:12:06 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-22 19:16:01 +0200 |
commit | 2674e7ea22ba0e22a2d1603bd51e0b8f6442a267 (patch) | |
tree | c9bd14aa06aae52d8a85ec0d74ee2a2def438500 /drivers/net/usb/cx82310_eth.c | |
parent | net: qmi_wwan: use dev_addr_mod() (diff) | |
download | linux-2674e7ea22ba0e22a2d1603bd51e0b8f6442a267.tar.xz linux-2674e7ea22ba0e22a2d1603bd51e0b8f6442a267.zip |
net: usb: don't write directly to netdev->dev_addr
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Manually fix all net/usb drivers without separate maintainers.
v2: catc does DMA to the buffer, leave the conversion to Oliver
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/usb/cx82310_eth.c')
-rw-r--r-- | drivers/net/usb/cx82310_eth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/usb/cx82310_eth.c index c4568a491dc4..79a47e2fd437 100644 --- a/drivers/net/usb/cx82310_eth.c +++ b/drivers/net/usb/cx82310_eth.c @@ -146,6 +146,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) u8 link[3]; int timeout = 50; struct cx82310_priv *priv; + u8 addr[ETH_ALEN]; /* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */ if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0 @@ -202,12 +203,12 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) goto err; /* get the MAC address */ - ret = cx82310_cmd(dev, CMD_GET_MAC_ADDR, true, NULL, 0, - dev->net->dev_addr, ETH_ALEN); + ret = cx82310_cmd(dev, CMD_GET_MAC_ADDR, true, NULL, 0, addr, ETH_ALEN); if (ret) { netdev_err(dev->net, "unable to read MAC address: %d\n", ret); goto err; } + eth_hw_addr_set(dev->net, addr); /* start (does not seem to have any effect?) */ ret = cx82310_cmd(dev, CMD_START, false, NULL, 0, NULL, 0); |