diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-04-19 17:27:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-04-20 12:45:28 +0300 |
commit | e1d6ca042e62c2a69513235f8629eb6e62ca79c5 (patch) | |
tree | cb2149f7d7b8d1adb3d658462c5b327d97c09235 /drivers/firmware/stratix10-svc.c | |
parent | 12124d16726ca7d9cb1eb8725767cbcfb96195c8 (diff) | |
download | linux-e1d6ca042e62c2a69513235f8629eb6e62ca79c5.tar.xz |
firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
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>
Link: https://lore.kernel.org/r/5f9a8cb4-5a4f-460b-9cdc-2fae6c5b7922@kili.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/firmware/stratix10-svc.c')
-rw-r--r-- | drivers/firmware/stratix10-svc.c | 4 |
1 files 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); |