[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221114025921.1194834-1-cuigaosheng1@huawei.com>
Date: Mon, 14 Nov 2022 10:59:21 +0800
From: Gaosheng Cui <cuigaosheng1@...wei.com>
To: <dinguyen@...nel.org>, <richard.gong@...el.com>,
<gregkh@...uxfoundation.org>, <atull@...nel.org>,
<cuigaosheng1@...wei.com>
CC: <linux-kernel@...r.kernel.org>
Subject: [PATCH] firmware: stratix10-svc: Fix IS_ERR() vs NULL check in stratix10_svc_drv_probe()
The svc_create_memory_pool() returns an ERR_PTR() on failure, we should use
IS_ERR() to check the return value, and return it on failure.
Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
Signed-off-by: Gaosheng Cui <cuigaosheng1@...wei.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 b4081f4d88a3..64e430c6f14a 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -1133,8 +1133,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.25.1
Powered by blists - more mailing lists