Skip to contentSkip to conversation

firmware: stratix10-svc: fix NULL vs IS_ERR() checking

PATCH New Miaoqian Lin 1 participant 1 message Dec 11, 2021 Intel STRATIX10 firmware drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: stratix10-svc: fix NULL vs IS_ERR() checking

The svc_create_memory_pool function does not return NULL. It returns error pointers.

---
 drivers/firmware/stratix10-svc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/stratix10-svc.c +2 -2
index 29c0a616b317..492c0bd0a76e 100644
@@ -989,8 +989,8 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
 		return ret;
 
 	genpool = svc_create_memory_pool(pdev, sh_memory);
-	if (!genpool)
-		return -ENOMEM;
+	if (IS_ERR(genpool))
+		return PTR_ERR(genpool);
 
 	/* allocate service controller and supporting channel */
 	controller = devm_kzalloc(dev, sizeof(*controller), GFP_KERNEL);
Signature · 1 line
2.17.1