From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Rex Lu <rex.lu@mediatek.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, Felix Fietkau <nbd@nbd.name>,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: drivers/net/wireless/mediatek/mt76/mt7996/mac.c:1651 mt7996_msdu_page_get_from_cache() warn: can 'p' even be NULL?
Date: Tue, 14 Oct 2025 10:47:44 +0300 [thread overview]
Message-ID: <202510100155.MS0IXhzm-lkp@intel.com> (raw)
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
reply other threads:[~2025-10-14 7:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202510100155.MS0IXhzm-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=rex.lu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox