summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMartin Kaiser <martin@kaiser.cx>2022-07-13 09:55:52 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-14 15:47:36 +0200
commit724933e37a90cfbaafc8d9e52d15fafc311cc6f2 (patch)
tree8fb02b92373016e8d4aef0e167555d6810d383c0 /drivers/staging
parentc1da5a7befa82c01e06c8ec2059bdc9ed422033b (diff)
downloadlinux-724933e37a90cfbaafc8d9e52d15fafc311cc6f2.tar.gz
linux-724933e37a90cfbaafc8d9e52d15fafc311cc6f2.tar.bz2
linux-724933e37a90cfbaafc8d9e52d15fafc311cc6f2.zip
staging: r8188eu: fall back to random mac address
Call eth_random_addr to generate a random mac address if we cannot load the mac address from the efuses. Do not use a constant mac address as fallback. This may create conflicts if we have several r8188eu devices on the network. Suggested-by: Joe Perches <joe@perches.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Reviewed-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220713075552.140927-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/r8188eu/hal/usb_halinit.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 695424bbecfc..421fe7c40390 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -912,11 +912,10 @@ exit:
static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
{
- u8 sMacAddr[6] = {0x00, 0xE0, 0x4C, 0x81, 0x88, 0x02};
struct eeprom_priv *eeprom = &adapt->eeprompriv;
if (AutoLoadFail) {
- memcpy(eeprom->mac_addr, sMacAddr, ETH_ALEN);
+ eth_random_addr(eeprom->mac_addr);
} else {
/* Read Permanent MAC address */
memcpy(eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU], ETH_ALEN);