Skip to content

Commit 3eda901

Browse files
Dan Carpenterrobclark
authored andcommitted
drm/msm/a3xx: fix error handling in a3xx_gpu_init()
These error paths returned 1 on failure, instead of a negative error code. This would lead to an Oops in the caller. A second problem is that the check for "if (ret != -ENODATA)" did not work because "ret" was set to 1. Fixes: 5785dd7 ("drm/msm: Fix duplicate gpu node in icc summary") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20211001125904.GK2283@kili Signed-off-by: Rob Clark <[email protected]>
1 parent 980d74e commit 3eda901

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/msm/adreno/a3xx_gpu.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,14 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
571571
}
572572

573573
icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
574-
ret = IS_ERR(icc_path);
575-
if (ret)
574+
if (IS_ERR(icc_path)) {
575+
ret = PTR_ERR(icc_path);
576576
goto fail;
577+
}
577578

578579
ocmem_icc_path = devm_of_icc_get(&pdev->dev, "ocmem");
579-
ret = IS_ERR(ocmem_icc_path);
580-
if (ret) {
580+
if (IS_ERR(ocmem_icc_path)) {
581+
ret = PTR_ERR(ocmem_icc_path);
581582
/* allow -ENODATA, ocmem icc is optional */
582583
if (ret != -ENODATA)
583584
goto fail;

0 commit comments

Comments
 (0)