All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 6051/6654] net/rxrpc/conn_client.c:494 rxrpc_maybe_add_conn() warn: inconsistent returns 'bundle->channel_lock'.
@ 2020-09-11  9:54 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-09-11  9:54 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3983 bytes --]

CC: kbuild-all(a)lists.01.org
TO: David Howells <dhowells@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7ce53e3a447bced7b85ed181c4d027e93c062e07
commit: 245500d853e9f20036cec7df4f6984ece4c6bf26 [6051/6654] rxrpc: Rewrite the client connection manager
:::::: branch date: 26 hours ago
:::::: commit date: 3 days ago
config: i386-randconfig-m021-20200911 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
net/rxrpc/conn_client.c:494 rxrpc_maybe_add_conn() warn: inconsistent returns 'bundle->channel_lock'.
net/rxrpc/conn_client.c:722 rxrpc_connect_call() error: 'bundle' dereferencing possible ERR_PTR()

# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=245500d853e9f20036cec7df4f6984ece4c6bf26
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 245500d853e9f20036cec7df4f6984ece4c6bf26
vim +494 net/rxrpc/conn_client.c

45025bceef17ed David Howells 2016-08-24  459  
45025bceef17ed David Howells 2016-08-24  460  /*
245500d853e9f2 David Howells 2020-07-01  461   * Add a connection to a bundle if there are no usable connections or we have
245500d853e9f2 David Howells 2020-07-01  462   * connections waiting for extra capacity.
45025bceef17ed David Howells 2016-08-24  463   */
245500d853e9f2 David Howells 2020-07-01  464  static void rxrpc_maybe_add_conn(struct rxrpc_bundle *bundle, gfp_t gfp)
45025bceef17ed David Howells 2016-08-24  465  {
245500d853e9f2 David Howells 2020-07-01  466  	struct rxrpc_call *call;
245500d853e9f2 David Howells 2020-07-01  467  	int i, usable;
45025bceef17ed David Howells 2016-08-24  468  
245500d853e9f2 David Howells 2020-07-01  469  	_enter("");
245500d853e9f2 David Howells 2020-07-01  470  
245500d853e9f2 David Howells 2020-07-01  471  	spin_lock(&bundle->channel_lock);
245500d853e9f2 David Howells 2020-07-01  472  
245500d853e9f2 David Howells 2020-07-01  473  	/* See if there are any usable connections. */
245500d853e9f2 David Howells 2020-07-01  474  	usable = 0;
245500d853e9f2 David Howells 2020-07-01  475  	for (i = 0; i < ARRAY_SIZE(bundle->conns); i++)
245500d853e9f2 David Howells 2020-07-01  476  		if (rxrpc_may_reuse_conn(bundle->conns[i]))
245500d853e9f2 David Howells 2020-07-01  477  			usable++;
245500d853e9f2 David Howells 2020-07-01  478  
245500d853e9f2 David Howells 2020-07-01  479  	if (!usable && !list_empty(&bundle->waiting_calls)) {
245500d853e9f2 David Howells 2020-07-01  480  		call = list_first_entry(&bundle->waiting_calls,
245500d853e9f2 David Howells 2020-07-01  481  					struct rxrpc_call, chan_wait_link);
245500d853e9f2 David Howells 2020-07-01  482  		if (test_bit(RXRPC_CALL_UPGRADE, &call->flags))
245500d853e9f2 David Howells 2020-07-01  483  			bundle->try_upgrade = true;
245500d853e9f2 David Howells 2020-07-01  484  	}
245500d853e9f2 David Howells 2020-07-01  485  
245500d853e9f2 David Howells 2020-07-01  486  	if (!usable)
245500d853e9f2 David Howells 2020-07-01  487  		goto alloc_conn;
245500d853e9f2 David Howells 2020-07-01  488  
245500d853e9f2 David Howells 2020-07-01  489  	spin_unlock(&bundle->channel_lock);
245500d853e9f2 David Howells 2020-07-01  490  	_leave("");
245500d853e9f2 David Howells 2020-07-01  491  	return;
245500d853e9f2 David Howells 2020-07-01  492  
245500d853e9f2 David Howells 2020-07-01  493  alloc_conn:
245500d853e9f2 David Howells 2020-07-01 @494  	return rxrpc_add_conn_to_bundle(bundle, gfp);
45025bceef17ed David Howells 2016-08-24  495  }
45025bceef17ed David Howells 2016-08-24  496  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32156 bytes --]

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

* [linux-next:master 6051/6654] net/rxrpc/conn_client.c:494 rxrpc_maybe_add_conn() warn: inconsistent returns 'bundle->channel_lock'.
@ 2020-09-11 12:18 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-09-11 12:18 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2770 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7ce53e3a447bced7b85ed181c4d027e93c062e07
commit: 245500d853e9f20036cec7df4f6984ece4c6bf26 [6051/6654] rxrpc: Rewrite the client connection manager
config: i386-randconfig-m021-20200911 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
net/rxrpc/conn_client.c:722 rxrpc_connect_call() error: 'bundle' dereferencing possible ERR_PTR()

# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=245500d853e9f20036cec7df4f6984ece4c6bf26
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 245500d853e9f20036cec7df4f6984ece4c6bf26
vim +494 net/rxrpc/conn_client.c


   697  int rxrpc_connect_call(struct rxrpc_sock *rx,
   698                         struct rxrpc_call *call,
   699                         struct rxrpc_conn_parameters *cp,
   700                         struct sockaddr_rxrpc *srx,
   701                         gfp_t gfp)
   702  {
   703          struct rxrpc_bundle *bundle;
   704          struct rxrpc_net *rxnet = cp->local->rxnet;
   705          int ret = 0;
   706  
   707          _enter("{%d,%lx},", call->debug_id, call->user_call_ID);
   708  
   709          rxrpc_discard_expired_client_conns(&rxnet->client_conn_reaper);
   710  
   711          bundle = rxrpc_prep_call(rx, call, cp, srx, gfp);
   712          if (IS_ERR(bundle)) {
   713                  ret = PTR_ERR(bundle);
   714                  goto out;
                        ^^^^^^^^

   715          }
   716  
   717          if (call->state == RXRPC_CALL_CLIENT_AWAIT_CONN) {
   718                  ret = rxrpc_wait_for_channel(bundle, call, gfp);
   719                  if (ret < 0)
   720                          goto wait_failed;
   721          }
   722  
   723  granted_channel:
   724          /* Paired with the write barrier in rxrpc_activate_one_channel(). */
   725          smp_rmb();
   726  
   727  out:
   728          rxrpc_put_bundle(bundle);
                                 ^^^^^^
Dereferenced inside function.

   729          _leave(" = %d", ret);
   730          return ret;
   731  
   732  wait_failed:
   733          spin_lock(&bundle->channel_lock);
   734          list_del_init(&call->chan_wait_link);
   735          spin_unlock(&bundle->channel_lock);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32156 bytes --]

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

* [linux-next:master 6051/6654] net/rxrpc/conn_client.c:494 rxrpc_maybe_add_conn() warn: inconsistent returns 'bundle->channel_lock'.
@ 2020-09-11 12:18 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-09-11 12:18 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2770 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7ce53e3a447bced7b85ed181c4d027e93c062e07
commit: 245500d853e9f20036cec7df4f6984ece4c6bf26 [6051/6654] rxrpc: Rewrite the client connection manager
config: i386-randconfig-m021-20200911 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
net/rxrpc/conn_client.c:722 rxrpc_connect_call() error: 'bundle' dereferencing possible ERR_PTR()

# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=245500d853e9f20036cec7df4f6984ece4c6bf26
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 245500d853e9f20036cec7df4f6984ece4c6bf26
vim +494 net/rxrpc/conn_client.c


   697  int rxrpc_connect_call(struct rxrpc_sock *rx,
   698                         struct rxrpc_call *call,
   699                         struct rxrpc_conn_parameters *cp,
   700                         struct sockaddr_rxrpc *srx,
   701                         gfp_t gfp)
   702  {
   703          struct rxrpc_bundle *bundle;
   704          struct rxrpc_net *rxnet = cp->local->rxnet;
   705          int ret = 0;
   706  
   707          _enter("{%d,%lx},", call->debug_id, call->user_call_ID);
   708  
   709          rxrpc_discard_expired_client_conns(&rxnet->client_conn_reaper);
   710  
   711          bundle = rxrpc_prep_call(rx, call, cp, srx, gfp);
   712          if (IS_ERR(bundle)) {
   713                  ret = PTR_ERR(bundle);
   714                  goto out;
                        ^^^^^^^^

   715          }
   716  
   717          if (call->state == RXRPC_CALL_CLIENT_AWAIT_CONN) {
   718                  ret = rxrpc_wait_for_channel(bundle, call, gfp);
   719                  if (ret < 0)
   720                          goto wait_failed;
   721          }
   722  
   723  granted_channel:
   724          /* Paired with the write barrier in rxrpc_activate_one_channel(). */
   725          smp_rmb();
   726  
   727  out:
   728          rxrpc_put_bundle(bundle);
                                 ^^^^^^
Dereferenced inside function.

   729          _leave(" = %d", ret);
   730          return ret;
   731  
   732  wait_failed:
   733          spin_lock(&bundle->channel_lock);
   734          list_del_init(&call->chan_wait_link);
   735          spin_unlock(&bundle->channel_lock);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32156 bytes --]

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

* Re: [linux-next:master 6051/6654] net/rxrpc/conn_client.c:494 rxrpc_maybe_add_conn() warn: inconsistent returns 'bundle->channel_lock'.
  2020-09-11 12:18 ` Dan Carpenter
  (?)
@ 2020-09-14 11:54 ` David Howells
  -1 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2020-09-14 11:54 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

Dan Carpenter <dan.carpenter@oracle.com> wrote:

> smatch warnings:
> net/rxrpc/conn_client.c:722 rxrpc_connect_call() error: 'bundle' dereferencing possible ERR_PTR()
> ...
>    722  

Line 722 is a blank line.  Looks like something didn't decode the line
correctly.

David

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

end of thread, other threads:[~2020-09-14 11:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-11 12:18 [linux-next:master 6051/6654] net/rxrpc/conn_client.c:494 rxrpc_maybe_add_conn() warn: inconsistent returns 'bundle->channel_lock' Dan Carpenter
2020-09-11 12:18 ` Dan Carpenter
2020-09-14 11:54 ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2020-09-11  9:54 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.