Skip to content

Commit

Permalink
staging: rtl8723bs: use ether_addr_copy() in rtw_macaddr_cfg()
Browse files Browse the repository at this point in the history
Use ether_addr_copy() instead of memcpy() to copy the mac address.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Michael Straube authored and Greg Kroah-Hartman committed Jun 28, 2018
1 parent 375a2bd commit 9579ba6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/rtl8723bs/core/rtw_ieee80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,15 +1172,15 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) {
mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk + 1]);
}
memcpy(mac_addr, mac, ETH_ALEN);
ether_addr_copy(mac_addr, mac);
} else{ /* Use the mac address stored in the Efuse */
memcpy(mac, mac_addr, ETH_ALEN);
ether_addr_copy(mac, mac_addr);
}

if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
if ((addr = of_get_property(np, "local-mac-address", &len)) &&
len == ETH_ALEN) {
memcpy(mac_addr, addr, ETH_ALEN);
ether_addr_copy(mac_addr, addr);
} else {
eth_random_addr(mac_addr);
DBG_871X("MAC Address from efuse error, assign random one !!!\n");
Expand Down

0 comments on commit 9579ba6

Please sign in to comment.