Linux CXL
 help / color / mirror / Atom feed
* [PATCH] cxl/region: Fix IS_ERR() vs NULL check
@ 2022-08-03  9:07 Dan Carpenter
  2022-08-03 15:43 ` Jonathan Cameron
  2022-08-05  0:23 ` Dan Williams
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2022-08-03  9:07 UTC (permalink / raw)
  To: Alison Schofield, Dan Williams, Ben Widawsky
  Cc: Vishal Verma, Ira Weiny, Jonathan Cameron, linux-cxl,
	kernel-janitors

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>
---
 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;
 	}
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-05  0:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-03  9:07 [PATCH] cxl/region: Fix IS_ERR() vs NULL check Dan Carpenter
2022-08-03 15:43 ` Jonathan Cameron
2022-08-05  0:23 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox