public inbox for [email protected]
 help / color / mirror / Atom feed
* [ammarfaizi2-block:dhowells/linux-fs/rxrpc-next 9/31] net/rxrpc/local_object.c:366 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 363)
@ 2022-11-23 15:55 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-11-23 15:55 UTC (permalink / raw)
  To: oe-kbuild, David Howells
  Cc: lkp, oe-kbuild-all, Ammar Faizi, GNU/Weeb Mailing List

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/rxrpc-next
head:   8b3d8f13ccbe35c57860620d82b12e1179a36fae
commit: fb083146ad0e0db772a6d3bab9401ac568df1d21 [9/31] rxrpc: trace: Don't use __builtin_return_address for rxrpc_local tracing
config: loongarch-randconfig-m041-20221120
compiler: loongarch64-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>

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

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

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

fb083146ad0e0d David Howells 2022-10-21  364  	int r, u;
fb083146ad0e0d David Howells 2022-10-21  365  
68553f1a6f746b David Howells 2019-08-09 @366  	if (local) {
                                                    ^^^^^
Too late.

fb083146ad0e0d David Howells 2022-10-21  367  		r = refcount_read(&local->ref);
fb083146ad0e0d David Howells 2022-10-21  368  		u = atomic_dec_return(&local->active_users);
fb083146ad0e0d David Howells 2022-10-21  369  		trace_rxrpc_local(debug_id, why, r, u);
fb083146ad0e0d David Howells 2022-10-21  370  		if (u == 0) {
fb083146ad0e0d David Howells 2022-10-21  371  			rxrpc_get_local(local, rxrpc_local_get_queue);
730c5fd42c1e36 David Howells 2019-08-09  372  			rxrpc_queue_local(local);
04d36d748fac34 David Howells 2020-01-30  373  		}
730c5fd42c1e36 David Howells 2019-08-09  374  	}
68553f1a6f746b David Howells 2019-08-09  375  }

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-23 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-23 15:55 [ammarfaizi2-block:dhowells/linux-fs/rxrpc-next 9/31] net/rxrpc/local_object.c:366 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 363) Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox