summaryrefslogtreecommitdiff
path: root/drivers/net/usb/sr9800.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-21 16:12:06 +0300
committerJakub Kicinski <kuba@kernel.org>2021-10-22 20:16:01 +0300
commit2674e7ea22ba0e22a2d1603bd51e0b8f6442a267 (patch)
treec9bd14aa06aae52d8a85ec0d74ee2a2def438500 /drivers/net/usb/sr9800.c
parent18867486fea3f9439c4c7e66e92146bd6bf3de85 (diff)
downloadlinux-2674e7ea22ba0e22a2d1603bd51e0b8f6442a267.tar.xz
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/sr9800.c')
-rw-r--r--drivers/net/usb/sr9800.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c
index 838f4e9e8b58..f5e19f3ef6cd 100644
--- a/drivers/net/usb/sr9800.c
+++ b/drivers/net/usb/sr9800.c
@@ -731,6 +731,7 @@ static int sr9800_bind(struct usbnet *dev, struct usb_interface *intf)
struct sr_data *data = (struct sr_data *)&dev->data;
u16 led01_mux, led23_mux;
int ret, embd_phy;
+ u8 addr[ETH_ALEN];
u32 phyid;
u16 rx_ctl;
@@ -754,12 +755,12 @@ static int sr9800_bind(struct usbnet *dev, struct usb_interface *intf)
}
/* Get the MAC address */
- ret = sr_read_cmd(dev, SR_CMD_READ_NODE_ID, 0, 0, ETH_ALEN,
- dev->net->dev_addr);
+ ret = sr_read_cmd(dev, SR_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, addr);
if (ret < 0) {
netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
return ret;
}
+ eth_hw_addr_set(dev->net, addr);
netdev_dbg(dev->net, "mac addr : %pM\n", dev->net->dev_addr);
/* Initialize MII structure */