All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] cxl/acpi: Introduce cxl_decoder objects
@ 2021-08-26 10:29 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-08-26 10:29 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-cxl

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-26 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 10:29 [bug report] cxl/acpi: Introduce cxl_decoder objects Dan Carpenter

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.