Linux CXL
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: dan.j.williams@intel.com
Cc: linux-cxl@vger.kernel.org
Subject: [bug report] cxl/acpi: Introduce cxl_decoder objects
Date: Thu, 26 Aug 2021 13:29:33 +0300	[thread overview]
Message-ID: <20210826102932.GA29711@kili> (raw)

Hello Dan Williams,

The patch 40ba17afdfab: "cxl/acpi: Introduce cxl_decoder objects"
from Jun 9, 2021, leads to the following
Smatch static checker warning:

	drivers/cxl/core/bus.c:504 devm_cxl_add_decoder()
	warn: 'cxld' isn't an ERR_PTR

drivers/cxl/core/bus.c
    494 int devm_cxl_add_decoder(struct device *host, struct cxl_decoder *cxld,
    495                          int *target_map)
    496 {
    497         struct cxl_port *port = to_cxl_port(cxld->dev.parent);
                                                    ^^^^^^^^^^^^^^^^
Dereference

    498         struct device *dev;
    499         int rc = 0, i;
    500 
    501         if (!cxld)
                    ^^^^^

    502                 return -EINVAL;
    503 
--> 504         if (IS_ERR(cxld))
                    ^^^^^^^^^^^^
These are too late.  But fortunately "cxld" is always valid.

    505                 return PTR_ERR(cxld);
    506 
    507         if (cxld->interleave_ways < 1) {
    508                 rc = -EINVAL;
    509                 goto err;
    510         }

regards,
dan carpenter

                 reply	other threads:[~2021-08-26 10:29 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 \
    --in-reply-to=20210826102932.GA29711@kili \
    --to=dan.carpenter@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    /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