[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211211051320.2206-1-linmq006@gmail.com>
Date: Sat, 11 Dec 2021 05:13:19 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: linmq006@...il.com, Dinh Nguyen <dinguyen@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH] firmware: stratix10-svc: fix NULL vs IS_ERR() checking
The svc_create_memory_pool function does not return NULL. It
returns error pointers.
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
drivers/firmware/stratix10-svc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
index 29c0a616b317..492c0bd0a76e 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -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);
--
2.17.1
Powered by blists - more mailing lists