* [PATCH] firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
@ 2023-04-19 14:27 Dan Carpenter
2023-04-27 18:58 ` Dinh Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-04-19 14:27 UTC (permalink / raw)
To: Richard Gong
Cc: Dinh Nguyen, Alan Tull, Greg Kroah-Hartman, Richard Gong,
linux-kernel, kernel-janitors
The svc_create_memory_pool() function returns error pointers. It never
returns NULL. Fix the check.
Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
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 bde1f543f529..80f4e2d14e04 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.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
2023-04-19 14:27 [PATCH] firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe Dan Carpenter
@ 2023-04-27 18:58 ` Dinh Nguyen
0 siblings, 0 replies; 2+ messages in thread
From: Dinh Nguyen @ 2023-04-27 18:58 UTC (permalink / raw)
To: Dan Carpenter, Richard Gong
Cc: Alan Tull, Greg Kroah-Hartman, linux-kernel, kernel-janitors
On 4/19/23 09:27, Dan Carpenter wrote:
> The svc_create_memory_pool() function returns error pointers. It never
> returns NULL. Fix the check.
>
> Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> 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 bde1f543f529..80f4e2d14e04 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);
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-27 18:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19 14:27 [PATCH] firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe Dan Carpenter
2023-04-27 18:58 ` Dinh Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®