[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYXvjAi0L-4casuv@stanley.mountain>
Date: Fri, 6 Feb 2026 16:41:32 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Jens Axboe <axboe@...nel.dk>
Cc: linux-block@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: [bug report] bio: add allocation cache abstraction
[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
Hello Jens Axboe,
Commit be4d234d7aeb ("bio: add allocation cache abstraction") from
Mar 8, 2021 (linux-next), leads to the following Smatch static
checker warning:
block/bio.c:790 bio_cpu_dead()
error: potential null dereference 'bs'. (hlist_entry_safe() returns null)
block/bio.c
785 static int bio_cpu_dead(unsigned int cpu, struct hlist_node *node)
786 {
787 struct bio_set *bs;
788
789 bs = hlist_entry_safe(node, struct bio_set, cpuhp_dead);
--> 790 if (bs->cache) {
It doesn't really make sense to use hlist_entry_safe() instead of
hlist_entry() if we're not going to check for NULL.
791 struct bio_alloc_cache *cache = per_cpu_ptr(bs->cache, cpu);
792
793 bio_alloc_cache_prune(cache, -1U);
794 }
795 return 0;
796 }
regards,
dan carpenter
Powered by blists - more mailing lists