[bug report] wifi: mt76: mt7925: add link handling in mt7925_txwi_free

Dan Carpenter dan.carpenter at linaro.org
Sat Jul 13 16:33:20 PDT 2024


Hello Sean Wang,

This is a semi-automatic email about new static checker warnings.

Commit 44eb173bdd4f ("wifi: mt76: mt7925: add link handling in
mt7925_txwi_free") from Jul 6, 2024, leads to the following Smatch
complaint:

    drivers/net/wireless/mediatek/mt76/mt7925/mac.c:856 mt7925_tx_check_aggr()
    warn: variable dereferenced before check 'sta' (see line 852)

drivers/net/wireless/mediatek/mt76/mt7925/mac.c
   851	
   852		link_sta = rcu_dereference(sta->link[wcid->link_id]);
                                           ^^^^^^^^^
Unchecked dereference

   853		if (!link_sta)
   854			return;
   855	
   856		if (!sta || !(link_sta->ht_cap.ht_supported || link_sta->he_cap.has_he))
                    ^^^^
Checked too late

   857			return;
   858	

regards,
dan carpenter



More information about the Linux-mediatek mailing list