Commit 980d74e7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Rob Clark

drm/msm/a4xx: fix error handling in a4xx_gpu_init()

This code returns 1 on error instead of a negative error.  It leads to
an Oops in the caller.  A second problem is that the check for
"if (ret != -ENODATA)" cannot be true because "ret" is set to 1.

Fixes: 5785dd7a ("drm/msm: Fix duplicate gpu node in icc summary")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211001125759.GJ2283@kiliSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 2133c4fc
...@@ -699,13 +699,14 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev) ...@@ -699,13 +699,14 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev)
} }
icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem"); icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
ret = IS_ERR(icc_path); if (IS_ERR(icc_path)) {
if (ret) ret = PTR_ERR(icc_path);
goto fail; goto fail;
}
ocmem_icc_path = devm_of_icc_get(&pdev->dev, "ocmem"); ocmem_icc_path = devm_of_icc_get(&pdev->dev, "ocmem");
ret = IS_ERR(ocmem_icc_path); if (IS_ERR(ocmem_icc_path)) {
if (ret) { ret = PTR_ERR(ocmem_icc_path);
/* allow -ENODATA, ocmem icc is optional */ /* allow -ENODATA, ocmem icc is optional */
if (ret != -ENODATA) if (ret != -ENODATA)
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment