Commit b09d5802 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller
Browse files

wilc1000: copy address before calling wilc_set_mac_address



wilc_set_mac_address() calls IO routines which don't guarantee
the pointer won't be written to. Make a copy.

Acked-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 54612b4a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -574,6 +574,7 @@ static int wilc_mac_open(struct net_device *ndev)
	struct wilc *wl = vif->wilc;
	int ret = 0;
	struct mgmt_frame_regs mgmt_regs = {};
	u8 addr[ETH_ALEN] __aligned(2);

	if (!wl || !wl->dev) {
		netdev_err(ndev, "device not ready\n");
@@ -596,10 +597,9 @@ static int wilc_mac_open(struct net_device *ndev)
				vif->idx);

	if (is_valid_ether_addr(ndev->dev_addr)) {
		wilc_set_mac_address(vif, ndev->dev_addr);
		ether_addr_copy(addr, ndev->dev_addr);
		wilc_set_mac_address(vif, addr);
	} else {
		u8 addr[ETH_ALEN];

		wilc_get_mac_address(vif, addr);
		eth_hw_addr_set(ndev, addr);
	}