Skip to content

Commit b655b83

Browse files
mistraubegregkh
authored andcommitted
staging: rtl8723bs: fall back to random mac address
Use a random mac address if we cannot load it from the efuses. Do not use a constant mac address as fallback. This may create conflicts if we have several rtl8723bs devices on the network. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 622c811 commit b655b83

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/staging/rtl8723bs/hal/sdio_halinit.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,14 +1014,10 @@ static void Hal_EfuseParseMACAddr_8723BS(
10141014
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
10151015
)
10161016
{
1017-
u16 i;
1018-
u8 sMacAddr[6] = {0x00, 0xE0, 0x4C, 0xb7, 0x23, 0x00};
10191017
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
10201018

10211019
if (AutoLoadFail) {
1022-
/* sMacAddr[5] = (u8)GetRandomNumber(1, 254); */
1023-
for (i = 0; i < 6; i++)
1024-
pEEPROM->mac_addr[i] = sMacAddr[i];
1020+
eth_random_addr(pEEPROM->mac_addr);
10251021
} else {
10261022
/* Read Permanent MAC address */
10271023
memcpy(pEEPROM->mac_addr, &hwinfo[EEPROM_MAC_ADDR_8723BS], ETH_ALEN);

0 commit comments

Comments
 (0)