From: Dan Williams <dan.j.williams@intel.com>
To: Ira Weiny <ira.weiny@intel.com>, Dan Williams <dan.j.williams@intel.com>
Cc: <linux-cxl@vger.kernel.org>, kernel test robot <lkp@intel.com>,
<vishal.l.verma@intel.com>, <alison.schofield@intel.com>,
<dave.jiang@intel.com>
Subject: Re: [PATCH 3/4] cxl/region: Fix port setup uninitialized variable warnings
Date: Thu, 4 Aug 2022 13:26:20 -0700 [thread overview]
Message-ID: <62ec2b6cb463b_881482944c@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <YurnLuV5Yin5JnkK@iweiny-desk3>
Ira Weiny wrote:
> On Wed, Aug 03, 2022 at 12:24:34AM -0700, Dan Williams wrote:
> > 0day robot reports:
> >
> > drivers/cxl/core/region.c:1068 cxl_port_setup_targets() error: uninitialized symbol 'eiw'.
> > drivers/cxl/core/region.c:1068 cxl_port_setup_targets() error: uninitialized symbol 'peig'.
> > drivers/cxl/core/region.c:1068 cxl_port_setup_targets() error: uninitialized symbol 'peiw'.
> >
> > ...which are all valid reports. Add debug statement to consume the,
> > albeit unexpected, errors.
> >
> > Fixes: 27b3f8d13830 ("cxl/region: Program target lists")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> > ---
> > drivers/cxl/core/region.c | 17 +++++++++++++++--
> > 1 file changed, 15 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> > index a073f16355ca..5c931b6eb4e7 100644
> > --- a/drivers/cxl/core/region.c
> > +++ b/drivers/cxl/core/region.c
> > @@ -1059,8 +1059,21 @@ static int cxl_port_setup_targets(struct cxl_port *port,
> > parent_iw = parent_cxld->interleave_ways;
> > }
> >
> > - granularity_to_cxl(parent_ig, &peig);
> > - ways_to_cxl(parent_iw, &peiw);
> > + rc = granularity_to_cxl(parent_ig, &peig);
> > + if (rc) {
> > + dev_dbg(&cxlr->dev, "%s:%s: invalid parent granularity: %d\n",
> > + dev_name(parent_port->uport),
> > + dev_name(&parent_port->dev), parent_ig);
> > + return rc;
> > + }
> > +
> > + rc = ways_to_cxl(parent_iw, &peiw);
> > + if (rc) {
> > + dev_dbg(&cxlr->dev, "%s:%s: invalid parent interleave: %d\n",
> > + dev_name(parent_port->uport),
> > + dev_name(&parent_port->dev), parent_iw);
> > + return rc;
> > + }
> >
> > iw = cxl_rr->nr_targets;
> > ways_to_cxl(iw, &eiw);
>
> Do you need to do something here to fix the potential uninitialized use of eiw?
Yup, good catch. Added:
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 7b794147bf7d..ab99c1c3b2e9 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -1004,7 +1004,13 @@ static int cxl_port_setup_targets(struct cxl_port *port,
}
iw = cxl_rr->nr_targets;
- ways_to_cxl(iw, &eiw);
+ rc = ways_to_cxl(iw, &eiw);
+ if (rc) {
+ dev_dbg(&cxlr->dev, "%s:%s: invalid port interleave: %d\n",
+ dev_name(port->uport), dev_name(&port->dev), iw);
+ return rc;
+ }
+
if (cxl_rr->nr_targets > 1) {
u32 address_bit = max(peig + peiw, eiw + peig);
next prev parent reply other threads:[~2022-08-04 20:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 7:24 [PATCH 0/4] cxl/region: Endpoint decoder fixes Dan Williams
2022-08-03 7:24 ` [PATCH 1/4] cxl/region: Fix decoder interleave programming Dan Williams
2022-08-03 15:24 ` Jonathan Cameron
2022-08-03 7:24 ` [PATCH 2/4] cxl/region: Move HPA setup to cxl_region_attach() Dan Williams
2022-08-03 15:25 ` Jonathan Cameron
2022-08-03 7:24 ` [PATCH 3/4] cxl/region: Fix port setup uninitialized variable warnings Dan Williams
2022-08-03 15:28 ` Jonathan Cameron
2022-08-03 21:22 ` Ira Weiny
2022-08-04 20:26 ` Dan Williams [this message]
2022-08-03 7:24 ` [PATCH 4/4] cxl/region: Fix region commit uninitialized variable warning Dan Williams
2022-08-03 15:41 ` Jonathan Cameron
2022-08-03 21:49 ` Ira Weiny
2022-08-03 22:07 ` Ira Weiny
2022-08-04 20:33 ` Dan Williams
2022-08-04 20:30 ` 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=62ec2b6cb463b_881482944c@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@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