From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alison Schofield <alison.schofield@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Ben Widawsky <bwidawsk@kernel.org>,
"Vishal Verma" <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>, <linux-cxl@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] cxl/region: Fix IS_ERR() vs NULL check
Date: Wed, 3 Aug 2022 16:43:44 +0100 [thread overview]
Message-ID: <20220803164344.000064e4@huawei.com> (raw)
In-Reply-To: <Yuo65lq2WtfdGJ0X@kili>
On Wed, 3 Aug 2022 12:07:50 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The nvdimm_pmem_region_create() function returns NULL on error. It does
> not return error pointers.
>
> Fixes: 04ad63f086d1 ("cxl/region: Introduce cxl_pmem_region objects")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
LGTM
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> drivers/cxl/pmem.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c
> index e69f99a0747d..7dc0a2fa1a6b 100644
> --- a/drivers/cxl/pmem.c
> +++ b/drivers/cxl/pmem.c
> @@ -525,8 +525,8 @@ static int cxl_pmem_region_probe(struct device *dev)
>
> cxlr_pmem->nd_region =
> nvdimm_pmem_region_create(cxl_nvb->nvdimm_bus, &ndr_desc);
> - if (IS_ERR(cxlr_pmem->nd_region)) {
> - rc = PTR_ERR(cxlr_pmem->nd_region);
> + if (!cxlr_pmem->nd_region) {
> + rc = -ENOMEM;
> goto err;
> }
>
next prev parent reply other threads:[~2022-08-03 15:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 9:07 [PATCH] cxl/region: Fix IS_ERR() vs NULL check Dan Carpenter
2022-08-03 15:43 ` Jonathan Cameron [this message]
2022-08-05 0:23 ` 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=20220803164344.000064e4@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=bwidawsk@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=dan.j.williams@intel.com \
--cc=ira.weiny@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--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