From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Dan Williams <dan.j.williams@intel.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Ben Widawsky <ben.widawsky@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
linux-kernel@vger.kernel.org
Subject: [cxl:preview 30/54] drivers/cxl/core/port.c:527 decoder_populate_targets() warn: inconsistent returns '&cxld->target_lock.lock'.
Date: Wed, 26 Jan 2022 13:08:33 +0300 [thread overview]
Message-ID: <202201250055.R82EBqL1-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git preview
head: d0687472d5b56e2018b833723082c2717e96c074
commit: a5d24e660f35f16cfe30031dcbd7356f7a002398 [30/54] cxl/core/port: Use dedicated lock for decoder target list
config: s390-randconfig-m031-20220120 (https://download.01.org/0day-ci/archive/20220125/202201250055.R82EBqL1-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.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:
drivers/cxl/core/port.c:527 decoder_populate_targets() warn: inconsistent returns '&cxld->target_lock.lock'.
vim +527 drivers/cxl/core/port.c
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 498 static int decoder_populate_targets(struct cxl_decoder *cxld,
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 499 struct cxl_port *port, int *target_map)
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 500 {
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 501 int rc = 0, i;
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 502
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 503 if (!target_map)
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 504 return 0;
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 505
42c377a63d21df drivers/cxl/core/port.c Dan Williams 2022-01-05 506 cxl_device_lock(&port->dev);
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 507 if (list_empty(&port->dports)) {
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 508 rc = -EINVAL;
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 509 goto out_unlock;
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 510 }
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 511
a5d24e660f35f1 drivers/cxl/core/port.c Dan Williams 2022-01-21 512 write_seqlock(&cxld->target_lock);
Lock
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 513 for (i = 0; i < cxld->nr_targets; i++) {
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 514 struct cxl_dport *dport = find_dport(port, target_map[i]);
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 515
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 516 if (!dport) {
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 517 rc = -ENXIO;
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 518 goto out_unlock;
Missing write_sequnlock() on this path
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 519 }
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 520 cxld->target[i] = dport;
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 521 }
a5d24e660f35f1 drivers/cxl/core/port.c Dan Williams 2022-01-21 522 write_sequnlock(&cxld->target_lock);
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 523
48667f676189ec drivers/cxl/core/bus.c Dan Williams 2021-09-21 524 out_unlock:
42c377a63d21df drivers/cxl/core/port.c Dan Williams 2022-01-05 525 cxl_device_unlock(&port->dev);
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 526
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 @527 return rc;
a5c25802168993 drivers/cxl/core/bus.c Dan Williams 2021-09-08 528 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2022-01-26 10:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 10:08 Dan Carpenter [this message]
2022-01-26 15:38 ` Dan Williams
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=202201250055.R82EBqL1-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=alison.schofield@intel.com \
--cc=ben.widawsky@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ira.weiny@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=vishal.l.verma@intel.com \
/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
Powered by JetHome