Search Linux Wireless

[bug report] wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Shayne Chen,

The patch 98686cd21624: "wifi: mt76: mt7996: add driver for MediaTek
Wi-Fi 7 (802.11be) devices" from Nov 22, 2022, leads to the following
Smatch static checker warning:

	drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c:72 mt7996_eeprom_load()
	error: uninitialized symbol 'free_block_num'.

drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c
    55 static int mt7996_eeprom_load(struct mt7996_dev *dev)
    56 {
    57         int ret;
    58 
    59         ret = mt76_eeprom_init(&dev->mt76, MT7996_EEPROM_SIZE);
    60         if (ret < 0)
    61                 return ret;
    62 
    63         if (ret) {
    64                 dev->flash_mode = true;
    65         } else {
    66                 u8 free_block_num;
    67                 u32 block_num, i;
    68 
    69                 /* TODO: check free block event */
    70                 mt7996_mcu_get_eeprom_free_block(dev, &free_block_num);

free_block_num is not initialized if mt7996_mcu_get_eeprom_free_block()
fails.

    71                 /* efuse info not enough */
--> 72                 if (free_block_num >= 59)
    73                         return -EINVAL;
    74 
    75                 /* read eeprom data from efuse */
    76                 block_num = DIV_ROUND_UP(MT7996_EEPROM_SIZE, MT7996_EEPROM_BLOCK_SIZE);
    77                 for (i = 0; i < block_num; i++)
    78                         mt7996_mcu_get_eeprom(dev, i * MT7996_EEPROM_BLOCK_SIZE);
    79         }
    80 
    81         return mt7996_check_eeprom(dev);
    82 }

regards,
dan carpenter



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux