source: trunk/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch @ 27860

Last change on this file since 27860 was 27860, checked in by nbd, 5 years ago

ath9k: fold patches that were merged upstream into 300-pending_work.patch

File size: 733 bytes
  • drivers/net/wireless/ath/ath9k/hw.c

    a b  
    1616 
    1717#include <linux/io.h> 
    1818#include <linux/slab.h> 
     19#include <linux/etherdevice.h> 
    1920#include <asm/unaligned.h> 
    2021 
    2122#include "hw.h" 
    static int ath9k_hw_init_macaddr(struct  
    453454                common->macaddr[2 * i] = eeval >> 8; 
    454455                common->macaddr[2 * i + 1] = eeval & 0xff; 
    455456        } 
    456         if (sum == 0 || sum == 0xffff * 3) 
    457                 return -EADDRNOTAVAIL; 
     457        if (!is_valid_ether_addr(common->macaddr)) { 
     458                ath_err(common, 
     459                        "eeprom contains invalid mac address: %pM\n", 
     460                        common->macaddr); 
     461 
     462                random_ether_addr(common->macaddr); 
     463                ath_err(common, 
     464                        "random mac address will be used: %pM\n", 
     465                        common->macaddr); 
     466        } 
    458467 
    459468        return 0; 
    460469} 
Note: See TracBrowser for help on using the repository browser.