All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: fs/coredump.c:399:15: warning: Redundant initialization for 'core_waiters'. The initialized value is overwritten before it is read. [redundantInitialization]
Date: Thu, 16 Jun 2022 21:47:15 +0800	[thread overview]
Message-ID: <202206162102.CcRdErxq-lkp@intel.com> (raw)

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

:::::: 
:::::: Manual check reason: "low confidence static check warning: fs/coredump.c:399:15: warning: Redundant initialization for 'core_waiters'. The initialized value is overwritten before it is read. [redundantInitialization]"
:::::: 

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: "Eric W. Biederman" <ebiederm@xmission.com>
CC: Kees Cook <keescook@chromium.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   30306f6194cadcc29c77f6ddcd416a75bf5c0232
commit: 0258b5fd7c7124b87e185a1a9322d2c66b1876b7 coredump: Limit coredumps to a single thread group
date:   8 months ago
:::::: branch date: 16 hours ago
:::::: commit date: 8 months ago
compiler: mips-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 0258b5fd7c7124b87e185a1a9322d2c66b1876b7
        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)

>> fs/coredump.c:399:15: warning: Redundant initialization for 'core_waiters'. The initialized value is overwritten before it is read. [redundantInitialization]
    core_waiters = zap_threads(tsk, core_state, exit_code);
                 ^
   fs/coredump.c:393:19: note: core_waiters is initialized
    int core_waiters = -EBUSY;
                     ^
   fs/coredump.c:399:15: note: core_waiters is overwritten
    core_waiters = zap_threads(tsk, core_state, exit_code);
                 ^

vim +/core_waiters +399 fs/coredump.c

10c28d937e2cca Alex Kelly        2012-09-26  389  
10c28d937e2cca Alex Kelly        2012-09-26  390  static int coredump_wait(int exit_code, struct core_state *core_state)
10c28d937e2cca Alex Kelly        2012-09-26  391  {
10c28d937e2cca Alex Kelly        2012-09-26  392  	struct task_struct *tsk = current;
10c28d937e2cca Alex Kelly        2012-09-26  393  	int core_waiters = -EBUSY;
10c28d937e2cca Alex Kelly        2012-09-26  394  
10c28d937e2cca Alex Kelly        2012-09-26  395  	init_completion(&core_state->startup);
10c28d937e2cca Alex Kelly        2012-09-26  396  	core_state->dumper.task = tsk;
10c28d937e2cca Alex Kelly        2012-09-26  397  	core_state->dumper.next = NULL;
10c28d937e2cca Alex Kelly        2012-09-26  398  
0258b5fd7c7124 Eric W. Biederman 2021-09-22 @399  	core_waiters = zap_threads(tsk, core_state, exit_code);
10c28d937e2cca Alex Kelly        2012-09-26  400  	if (core_waiters > 0) {
10c28d937e2cca Alex Kelly        2012-09-26  401  		struct core_thread *ptr;
10c28d937e2cca Alex Kelly        2012-09-26  402  
70d78fe7c8b640 Andrey Ryabinin   2016-11-10  403  		freezer_do_not_count();
10c28d937e2cca Alex Kelly        2012-09-26  404  		wait_for_completion(&core_state->startup);
70d78fe7c8b640 Andrey Ryabinin   2016-11-10  405  		freezer_count();
10c28d937e2cca Alex Kelly        2012-09-26  406  		/*
10c28d937e2cca Alex Kelly        2012-09-26  407  		 * Wait for all the threads to become inactive, so that
10c28d937e2cca Alex Kelly        2012-09-26  408  		 * all the thread context (extended register state, like
10c28d937e2cca Alex Kelly        2012-09-26  409  		 * fpu etc) gets copied to the memory.
10c28d937e2cca Alex Kelly        2012-09-26  410  		 */
10c28d937e2cca Alex Kelly        2012-09-26  411  		ptr = core_state->dumper.next;
10c28d937e2cca Alex Kelly        2012-09-26  412  		while (ptr != NULL) {
10c28d937e2cca Alex Kelly        2012-09-26  413  			wait_task_inactive(ptr->task, 0);
10c28d937e2cca Alex Kelly        2012-09-26  414  			ptr = ptr->next;
10c28d937e2cca Alex Kelly        2012-09-26  415  		}
10c28d937e2cca Alex Kelly        2012-09-26  416  	}
10c28d937e2cca Alex Kelly        2012-09-26  417  
10c28d937e2cca Alex Kelly        2012-09-26  418  	return core_waiters;
10c28d937e2cca Alex Kelly        2012-09-26  419  }
10c28d937e2cca Alex Kelly        2012-09-26  420  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

             reply	other threads:[~2022-06-16 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 13:47 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-17  9:50 fs/coredump.c:399:15: warning: Redundant initialization for 'core_waiters'. The initialized value is overwritten before it is read. [redundantInitialization] kernel test robot
2022-06-16  5:45 kernel test robot
2022-05-14  2:53 kernel test robot
2022-04-30  5:11 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=202206162102.CcRdErxq-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.