mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 04:20:23 +09:00
firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
[ Upstream commite1d6ca042e] The svc_create_memory_pool() function returns error pointers. It never returns NULL. Fix the check. Fixes:7ca5ce8965("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ee53a7a880
commit
59ecc2cf34
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user