BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: netdev@vger.kernel.org TO: Eric Dumazet 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}() :::::: branch date: 11 hours ago :::::: commit date: 19 hours ago 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 | Reported-by: Dan Carpenter 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 d565b0a1a9b6ee Herbert Xu 2008-12-15 6392 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; 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 } 3b47d30396bae4 Eric Dumazet 2014-11-06 6415 EXPORT_SYMBOL(napi_disable); 3b47d30396bae4 Eric Dumazet 2014-11-06 6416 -- 0-DAY CI Kernel Test Service https://01.org/lkp