oe-kbuild.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, David Howells <dhowells@redhat.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 11514/13282] net/rxrpc/local_object.c:365 rxrpc_unuse_local() warn: variable dereferenced before check 'local' (see line 362)
Date: Wed, 7 Dec 2022 09:52:24 +0300	[thread overview]
Message-ID: <202212071248.8BB84G9K-lkp@intel.com> (raw)
Message-ID: <20221207065224.REvHetUQxrxN1aLq6GH0ep2lz8fCxu7a3x5rQ_uC5xk@z> (raw)

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


             reply	other threads:[~2022-12-07  6:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07  4:14 kernel test robot [this message]
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

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=202212071248.8BB84G9K-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --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).