All of lore.kernel.org
 help / color / mirror / Atom feed
* 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]
@ 2022-04-25 19:16 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-25 19:16 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6019 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
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:   d615b5416f8a1afeb82d13b238f8152c572d59c0
commit: 401fb12c68c257b9c9116b1475c0ac26b646fcc0 mm/sl*b: Differentiate struct slab fields by sl*b implementations
date:   4 months ago
:::::: branch date: 75 minutes ago
:::::: commit date: 4 months ago
compiler: alpha-linux-gcc (GCC) 11.2.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 as appropriate
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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]
@ 2022-08-30 19:55 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-08-30 19:55 UTC (permalink / raw)
  To: kbuild

[-- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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]
@ 2022-03-31 17:25 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-03-31 17:25 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5801 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
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:   787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 401fb12c68c257b9c9116b1475c0ac26b646fcc0 mm/sl*b: Differentiate struct slab fields by sl*b implementations
date:   3 months ago
:::::: branch date: 19 hours ago
:::::: commit date: 3 months ago
compiler: or1k-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-30 19:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2022-08-30 19:55 kernel test robot
2022-03-31 17:25 kernel test robot

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.