mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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: 04ad63f086 ("cxl/region: Introduce cxl_pmem_region objects")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Link: https://lore.kernel.org/r/Yuo65lq2WtfdGJ0X@kili
Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
1 parent
e29a8995d6
commit
9fd2cf4d6f
1 file changed
+2
-2
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user