oe-kbuild.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Eric Dumazet <edumazet@google.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, netdev@vger.kernel.org
Subject: [net-next:master 25/27] net/core/dev.c:6409 napi_disable() error: uninitialized symbol 'new'.
Date: Thu, 17 Nov 2022 10:36:19 +0300	[thread overview]
Message-ID: <202211171520.UF5VyYSH-lkp@intel.com> (raw)
Message-ID: <20221117073619.mRaGPxq1akmk0iWLpDPM3sN_IvDoV32Xs5BB09ByQV4@z> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   d82303df06481235fe7cbaf605075e0c2c87e99b
commit: 4ffa1d1c6842a97e84cfbe56bfcf70edb23608e2 [25/27] net: adopt try_cmpxchg() in napi_{enable|disable}()
config: i386-randconfig-m021
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>

New smatch warnings:
net/core/dev.c:6409 napi_disable() error: uninitialized symbol 'new'.

Old smatch warnings:
net/core/dev.c:10356 netdev_run_todo() warn: passing freed memory 'dev'

vim +/new +6409 net/core/dev.c

3b47d30396bae4 Eric Dumazet   2014-11-06  6393  void napi_disable(struct napi_struct *n)
3b47d30396bae4 Eric Dumazet   2014-11-06  6394  {
719c571970109b Jakub Kicinski 2021-09-24  6395  	unsigned long val, new;
719c571970109b Jakub Kicinski 2021-09-24  6396  
3b47d30396bae4 Eric Dumazet   2014-11-06  6397  	might_sleep();
3b47d30396bae4 Eric Dumazet   2014-11-06  6398  	set_bit(NAPI_STATE_DISABLE, &n->state);
3b47d30396bae4 Eric Dumazet   2014-11-06  6399  
719c571970109b Jakub Kicinski 2021-09-24  6400  	val = READ_ONCE(n->state);
4ffa1d1c6842a9 Eric Dumazet   2022-11-15  6401  	do {
719c571970109b Jakub Kicinski 2021-09-24  6402  		if (val & (NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC)) {
719c571970109b Jakub Kicinski 2021-09-24  6403  			usleep_range(20, 200);
719c571970109b Jakub Kicinski 2021-09-24  6404  			continue;

"new" not initialized for first iteration through the loop.

719c571970109b Jakub Kicinski 2021-09-24  6405  		}
719c571970109b Jakub Kicinski 2021-09-24  6406  
719c571970109b Jakub Kicinski 2021-09-24  6407  		new = val | NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC;
719c571970109b Jakub Kicinski 2021-09-24  6408  		new &= ~(NAPIF_STATE_THREADED | NAPIF_STATE_PREFER_BUSY_POLL);
4ffa1d1c6842a9 Eric Dumazet   2022-11-15 @6409  	} while (!try_cmpxchg(&n->state, &val, new));
                                                                                               ^^^

3b47d30396bae4 Eric Dumazet   2014-11-06  6410  
3b47d30396bae4 Eric Dumazet   2014-11-06  6411  	hrtimer_cancel(&n->timer);
3b47d30396bae4 Eric Dumazet   2014-11-06  6412  
3b47d30396bae4 Eric Dumazet   2014-11-06  6413  	clear_bit(NAPI_STATE_DISABLE, &n->state);
3b47d30396bae4 Eric Dumazet   2014-11-06  6414  }

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


             reply	other threads:[~2022-11-17  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  7:27 kernel test robot [this message]
2022-11-17  7:36 ` [net-next:master 25/27] net/core/dev.c:6409 napi_disable() error: uninitialized symbol 'new' Dan Carpenter
2022-11-17  8:51 ` Eric Dumazet

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=202211171520.UF5VyYSH-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=edumazet@google.com \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).