Skip to contentSkip to conversation

mt76: mt7615: fix TSF configuration

bug report Dan Carpenter 1 participant 1 message Apr 21, 2021 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

Hello Ryder Lee,

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

The patch a4a5a430b076: "mt76: mt7615: fix TSF configuration" from Feb 23, 2021, leads to the following Smatch complaint:

drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c:74 mt7663_usb_sdio_set_rates()
warn: variable dereferenced before check 'sta' (see line 70)

drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c

    69		u32 w5, w27, addr, val;
    70		u16 idx = sta->vif->mt76.omac_idx;
                          ^^^^^^^^^^^^^^

The patch adds a new dereference

    71	
    72		lockdep_assert_held(&dev->mt76.mutex);
    73	
    74		if (!sta)
                     ^^^

The old code checks for NULL

    75			return -EINVAL;
    76	

regards,
dan carpenter

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek