linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 11514/13282] net/rxrpc/local_object.c:365 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 362)
@ 2022-12-07  6:52 Dan Carpenter
  2022-12-07 16:18 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-12-07  6:52 UTC (permalink / raw)
  To: oe-kbuild, David Howells; +Cc: lkp, oe-kbuild-all, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5d562c48a21eeb029a8fd3f18e1b31fd83660474
commit: a2cf3264f331acfeb7e463ad7b7fe1ac647a829d [11514/13282] rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local()
config: arm64-randconfig-m041-20221206
compiler: aarch64-linux-gcc (GCC) 12.1.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>

smatch warnings:
net/rxrpc/local_object.c:365 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 362)

vim +/local +365 net/rxrpc/local_object.c

0fde882fc9ee9c David Howells 2022-10-21  360  void rxrpc_unuse_local(struct rxrpc_local *local, enum rxrpc_local_trace why)
730c5fd42c1e36 David Howells 2019-08-09  361  {
a2cf3264f331ac David Howells 2022-11-16 @362  	unsigned int debug_id = local->debug_id;
                                                                        ^^^^^^^^^^^^^^^
Dereference

a2cf3264f331ac David Howells 2022-11-16  363  	int r, u;
a2cf3264f331ac David Howells 2022-11-16  364  
a2cf3264f331ac David Howells 2022-11-16 @365  	if (local) {
                                                    ^^^^^
Checked too late.

a2cf3264f331ac David Howells 2022-11-16  366  		r = refcount_read(&local->ref);
a2cf3264f331ac David Howells 2022-11-16  367  		u = atomic_dec_return(&local->active_users);
a2cf3264f331ac David Howells 2022-11-16  368  		trace_rxrpc_local(debug_id, why, r, u);
a2cf3264f331ac David Howells 2022-11-16  369  		if (u == 0)
a275da62e8c111 David Howells 2022-10-10  370  			kthread_stop(local->io_thread);
68553f1a6f746b David Howells 2019-08-09  371  	}
a2cf3264f331ac David Howells 2022-11-16  372  }

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



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

* Re: [linux-next:master 11514/13282] net/rxrpc/local_object.c:365 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 362)
  2022-12-07  6:52 [linux-next:master 11514/13282] net/rxrpc/local_object.c:365 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 362) Dan Carpenter
@ 2022-12-07 16:18 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2022-12-07 16:18 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: dhowells, oe-kbuild, lkp, oe-kbuild-all,
	Linux Memory Management List

I have a patch for this already, thanks.

David



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

end of thread, other threads:[~2022-12-07 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-07  6:52 [linux-next:master 11514/13282] net/rxrpc/local_object.c:365 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 362) Dan Carpenter
2022-12-07 16:18 ` David Howells

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).