public inbox for [email protected]
 help / color / mirror / Atom feed
From: Dan Carpenter <[email protected]>
To: [email protected], David Howells <[email protected]>
Cc: [email protected], [email protected],
	Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: [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)
Date: Wed, 23 Nov 2022 18:55:07 +0300	[thread overview]
Message-ID: <[email protected]> (raw)

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


                 reply	other threads:[~2022-11-23 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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