* drivers/net/wireless/mediatek/mt76/mt7996/mac.c:1651 mt7996_msdu_page_get_from_cache() warn: can 'p' even be NULL?
@ 2025-10-14 7:47 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2025-10-14 7:47 UTC (permalink / raw)
To: oe-kbuild, Rex Lu
Cc: lkp, oe-kbuild-all, linux-kernel, Felix Fietkau, Lorenzo Bianconi
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
config: x86_64-randconfig-161-20251009 (https://download.01.org/0day-ci/archive/20251010/202510100155.MS0IXhzm-lkp@intel.com/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 <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202510100155.MS0IXhzm-lkp@intel.com/
New smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7996/mac.c:1651 mt7996_msdu_page_get_from_cache() warn: can 'p' even be NULL?
vim +/p +1651 drivers/net/wireless/mediatek/mt76/mt7996/mac.c
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)
This NULL check is pointless. We already ensured that the list is not
empty.
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 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-10-14 7:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 7:47 drivers/net/wireless/mediatek/mt76/mt7996/mac.c:1651 mt7996_msdu_page_get_from_cache() warn: can 'p' even be NULL? Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox