Skip to contentSkip to conversation

drivers/net/wireless/mediatek/mt76/mt7996/mac.c:1651 mt7996_msdu_page_get_from_cache() warn: can 'p' even be NULL?

DISCUSSION Dan Carpenter 1 participant 1 message Oct 9, 2025

lore
Share & tools
lore

Dan Carpenter

author build bot
#0 lore raw

BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Rex Lu <[email protected]>
CC: Felix Fietkau <[email protected]>
CC: Lorenzo Bianconi <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ec714e371f22f716a04e6ecb2a24988c92b26911
commit: b1e58e137b61693f12da037d2d50aca9c2140a43 wifi: mt76: mt7996: Introduce RRO MSDU callbacks
date:   3 weeks ago

:::::: branch date: 15 hours ago
:::::: commit date: 3 weeks ago
config: x86_64-randconfig-161-20251009 (https://download.01.org/0day-ci/archive/20251010/[email protected]/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

New smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7996/mac.c:1651 mt7996_msdu_page_get_from_cache() warn: can 'p' even be NULL?

Old smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7996/mac.c:483 mt7996_mac_fill_rx() warn: potential spectre issue 'dev->mt76.phys' [r] drivers/net/wireless/mediatek/mt76/mt7996/mac.c:484 mt7996_mac_fill_rx() warn: possible spectre second half. 'mphy' drivers/net/wireless/mediatek/mt76/mt7996/mac.c:3061 mt7996_mac_twt_sched_list_add() error: uninitialized symbol 'start_tsf'.

vim +/p +1651 drivers/net/wireless/mediatek/mt76/mt7996/mac.c

98686cd21624c7 Shayne Chen 2022-11-22  1640  
b1e58e137b6169 Rex Lu      2025-09-09  1641  static struct mt7996_msdu_page *
b1e58e137b6169 Rex Lu      2025-09-09  1642  mt7996_msdu_page_get_from_cache(struct mt7996_dev *dev)
b1e58e137b6169 Rex Lu      2025-09-09  1643  {
b1e58e137b6169 Rex Lu      2025-09-09  1644  	struct mt7996_msdu_page *p = NULL;
b1e58e137b6169 Rex Lu      2025-09-09  1645  
b1e58e137b6169 Rex Lu      2025-09-09  1646  	spin_lock(&dev->wed_rro.lock);
b1e58e137b6169 Rex Lu      2025-09-09  1647  
b1e58e137b6169 Rex Lu      2025-09-09  1648  	if (!list_empty(&dev->wed_rro.page_cache)) {
b1e58e137b6169 Rex Lu      2025-09-09  1649  		p = list_first_entry(&dev->wed_rro.page_cache,
b1e58e137b6169 Rex Lu      2025-09-09  1650  				     struct mt7996_msdu_page, list);
b1e58e137b6169 Rex Lu      2025-09-09 @1651  		if (p)
b1e58e137b6169 Rex Lu      2025-09-09  1652  			list_del(&p->list);
b1e58e137b6169 Rex Lu      2025-09-09  1653  	}
b1e58e137b6169 Rex Lu      2025-09-09  1654  
b1e58e137b6169 Rex Lu      2025-09-09  1655  	spin_unlock(&dev->wed_rro.lock);
b1e58e137b6169 Rex Lu      2025-09-09  1656  
b1e58e137b6169 Rex Lu      2025-09-09  1657  	return p;
b1e58e137b6169 Rex Lu      2025-09-09  1658  }
b1e58e137b6169 Rex Lu      2025-09-09  1659  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki