staging: use eth_hw_addr_set() in orphan drivers

Commit 406f42fa0d ("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.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-9-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jakub Kicinski 2021-10-19 10:12:43 -07:00 committed by Greg Kroah-Hartman
parent e7c636f2bb
commit 524b09ea34
3 changed files with 7 additions and 3 deletions

View File

@ -867,6 +867,7 @@ int register_lte_device(struct phy_dev *phy_dev,
struct nic *nic;
struct net_device *net;
char pdn_dev_name[16];
u8 addr[ETH_ALEN];
int ret = 0;
u8 index;
@ -893,11 +894,12 @@ int register_lte_device(struct phy_dev *phy_dev,
nic->phy_dev = phy_dev;
nic->nic_id = index;
form_mac_address(net->dev_addr,
form_mac_address(addr,
nic->src_mac_addr,
nic->dest_mac_addr,
mac_address,
index);
eth_hw_addr_set(net, addr);
SET_NETDEV_DEV(net, dev);
SET_NETDEV_DEVTYPE(net, &wwan_type);

View File

@ -350,7 +350,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
(cvmx_helper_interface_get_mode(interface) !=
CVMX_HELPER_INTERFACE_MODE_SPI)) {
int i;
u8 *ptr = dev->dev_addr;
const u8 *ptr = dev->dev_addr;
u64 mac = 0;
int index = INDEX(priv->port);

View File

@ -585,6 +585,7 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
struct hfa384x *hw = wlandev->priv;
u16 temp;
u8 snum[HFA384x_RID_NICSERIALNUMBER_LEN];
u8 addr[ETH_ALEN];
/* Collect version and compatibility info */
/* Some are critical, some are not */
@ -855,11 +856,12 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
/* Collect the MAC address */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR,
wlandev->netdev->dev_addr, ETH_ALEN);
addr, ETH_ALEN);
if (result != 0) {
netdev_err(wlandev->netdev, "Failed to retrieve mac address\n");
goto failed;
}
eth_hw_addr_set(wlandev->netdev, addr);
/* short preamble is always implemented */
wlandev->nsdcaps |= P80211_NSDCAP_SHORT_PREAMBLE;