From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: mm/slab_common.c:443:24: warning: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list [uninitvar]
Date: Wed, 31 Aug 2022 03:55:54 +0800 [thread overview]
Message-ID: <202208310352.rUnVMxsn-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6289 bytes --]
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: mm/slab_common.c:443:24: warning: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list [uninitvar]"
::::::
BCC: lkp(a)intel.com
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vlastimil Babka <vbabka@suse.cz>
CC: Roman Gushchin <guro@fb.com>
CC: Hyeonggon Yoo <42.hyeyoo@gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dcf8e5633e2e69ad60b730ab5905608b756a032f
commit: 401fb12c68c257b9c9116b1475c0ac26b646fcc0 mm/sl*b: Differentiate struct slab fields by sl*b implementations
date: 8 months ago
:::::: branch date: 23 hours ago
:::::: commit date: 8 months ago
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 401fb12c68c257b9c9116b1475c0ac26b646fcc0
cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
mm/slab_common.c:187:48: warning: Parameter 'ctor' can be declared with const [constParameter]
slab_flags_t flags, const char *name, void (*ctor)(void *))
^
>> mm/slab_common.c:443:24: warning: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list [uninitvar]
debugfs_slab_release(s);
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:443:24: note: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list
debugfs_slab_release(s);
^
vim +443 mm/slab_common.c
3965fc36522446 Vladimir Davydov 2014-01-23 418
657dc2f9722092 Tejun Heo 2017-02-22 419 static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work)
d5b3cf7139b877 Vladimir Davydov 2015-02-10 420 {
657dc2f9722092 Tejun Heo 2017-02-22 421 LIST_HEAD(to_destroy);
657dc2f9722092 Tejun Heo 2017-02-22 422 struct kmem_cache *s, *s2;
d5b3cf7139b877 Vladimir Davydov 2015-02-10 423
657dc2f9722092 Tejun Heo 2017-02-22 424 /*
5f0d5a3ae7cff0 Paul E. McKenney 2017-01-18 425 * On destruction, SLAB_TYPESAFE_BY_RCU kmem_caches are put on the
657dc2f9722092 Tejun Heo 2017-02-22 426 * @slab_caches_to_rcu_destroy list. The slab pages are freed
081a06fa299066 Randy Dunlap 2020-08-11 427 * through RCU and the associated kmem_cache are dereferenced
657dc2f9722092 Tejun Heo 2017-02-22 428 * while freeing the pages, so the kmem_caches should be freed only
657dc2f9722092 Tejun Heo 2017-02-22 429 * after the pending RCU operations are finished. As rcu_barrier()
657dc2f9722092 Tejun Heo 2017-02-22 430 * is a pretty slow operation, we batch all pending destructions
657dc2f9722092 Tejun Heo 2017-02-22 431 * asynchronously.
657dc2f9722092 Tejun Heo 2017-02-22 432 */
657dc2f9722092 Tejun Heo 2017-02-22 433 mutex_lock(&slab_mutex);
657dc2f9722092 Tejun Heo 2017-02-22 434 list_splice_init(&slab_caches_to_rcu_destroy, &to_destroy);
657dc2f9722092 Tejun Heo 2017-02-22 435 mutex_unlock(&slab_mutex);
d5b3cf7139b877 Vladimir Davydov 2015-02-10 436
657dc2f9722092 Tejun Heo 2017-02-22 437 if (list_empty(&to_destroy))
657dc2f9722092 Tejun Heo 2017-02-22 438 return;
657dc2f9722092 Tejun Heo 2017-02-22 439
657dc2f9722092 Tejun Heo 2017-02-22 440 rcu_barrier();
657dc2f9722092 Tejun Heo 2017-02-22 441
657dc2f9722092 Tejun Heo 2017-02-22 442 list_for_each_entry_safe(s, s2, &to_destroy, list) {
64dd68497be76a Faiyaz Mohammed 2021-06-28 @443 debugfs_slab_release(s);
d3fb45f370d927 Alexander Potapenko 2021-02-25 444 kfence_shutdown_cache(s);
657dc2f9722092 Tejun Heo 2017-02-22 445 #ifdef SLAB_SUPPORTS_SYSFS
657dc2f9722092 Tejun Heo 2017-02-22 446 sysfs_slab_release(s);
657dc2f9722092 Tejun Heo 2017-02-22 447 #else
657dc2f9722092 Tejun Heo 2017-02-22 448 slab_kmem_cache_release(s);
657dc2f9722092 Tejun Heo 2017-02-22 449 #endif
657dc2f9722092 Tejun Heo 2017-02-22 450 }
d5b3cf7139b877 Vladimir Davydov 2015-02-10 451 }
d5b3cf7139b877 Vladimir Davydov 2015-02-10 452
:::::: The code at line 443 was first introduced by commit
:::::: 64dd68497be76ab4e237cca06f5324e220d0f050 mm: slub: move sysfs slab alloc/free interfaces to debugfs
:::::: TO: Faiyaz Mohammed <faiyazm@codeaurora.org>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-08-30 19:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 19:55 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-04-25 19:16 mm/slab_common.c:443:24: warning: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list [uninitvar] kernel test robot
2022-03-31 17:25 kernel test robot
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=202208310352.rUnVMxsn-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.