aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath5k/eeprom.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath5k/eeprom.c b/drivers/net/wireless/ath5k/eeprom.c
index a54ee7e4967b..ac45ca47ca87 100644
--- a/drivers/net/wireless/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath5k/eeprom.c
@@ -1418,14 +1418,11 @@ ath5k_eeprom_init(struct ath5k_hw *ah)
1418 */ 1418 */
1419int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac) 1419int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
1420{ 1420{
1421 u8 mac_d[ETH_ALEN]; 1421 u8 mac_d[ETH_ALEN] = {};
1422 u32 total, offset; 1422 u32 total, offset;
1423 u16 data; 1423 u16 data;
1424 int octet, ret; 1424 int octet, ret;
1425 1425
1426 memset(mac, 0, ETH_ALEN);
1427 memset(mac_d, 0, ETH_ALEN);
1428
1429 ret = ath5k_hw_eeprom_read(ah, 0x20, &data); 1426 ret = ath5k_hw_eeprom_read(ah, 0x20, &data);
1430 if (ret) 1427 if (ret)
1431 return ret; 1428 return ret;
@@ -1441,11 +1438,11 @@ int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
1441 octet += 2; 1438 octet += 2;
1442 } 1439 }
1443 1440
1444 memcpy(mac, mac_d, ETH_ALEN);
1445
1446 if (!total || total == 3 * 0xffff) 1441 if (!total || total == 3 * 0xffff)
1447 return -EINVAL; 1442 return -EINVAL;
1448 1443
1444 memcpy(mac, mac_d, ETH_ALEN);
1445
1449 return 0; 1446 return 0;
1450} 1447}
1451 1448