[bug report] wifi: mt76: mt7996: improve hardware restart reliability

Dan Carpenter dan.carpenter at linaro.org
Tue Sep 23 04:26:55 PDT 2025


Hello Felix Fietkau,

Commit ace5d3b6b49e ("wifi: mt76: mt7996: improve hardware restart
reliability") from Sep 15, 2025 (linux-next), leads to the following
Smatch static checker warning:

	drivers/net/wireless/mediatek/mt76/mt7996/mac.c:2458 mt7996_mac_full_reset()
	warn: assigning signed to unsigned

drivers/net/wireless/mediatek/mt76/mt7996/mac.c
    2448         while (!list_empty(&list)) {
    2449                 struct mt7996_wed_rro_session_id *e;
    2450 
    2451                 e = list_first_entry(&list, struct mt7996_wed_rro_session_id,
    2452                                      list);
    2453                 list_del_init(&e->list);
    2454                 kfree(e);
    2455         }
    2456 
    2457         i = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7996_WTBL_STA);

i could be -1

--> 2458         dev->mt76.global_wcid.idx = i;
                                       ^^^^^^^^
saving -1 to a u16

    2459         dev->recovery.hw_full_reset = false;
    2460 
    2461         mutex_unlock(&dev->mt76.mutex);
    2462 
    2463         ieee80211_restart_hw(mt76_hw(dev));
    2464 }

regards,
dan carpenter



More information about the Linux-mediatek mailing list