Commit 9fd2cf4d authored by Dan Carpenter's avatar Dan Carpenter Committed by Dan Williams

cxl/region: Fix IS_ERR() vs NULL check

The nvdimm_pmem_region_create() function returns NULL on error.  It does
not return error pointers.

Fixes: 04ad63f0 ("cxl/region: Introduce cxl_pmem_region objects")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/Yuo65lq2WtfdGJ0X@kiliSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent e29a8995
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment