[PATCH 3/5] drm/msm: Fix IS_ERR_OR_NULL() vs NULL check in msm_icc_get()

Gaosheng Cui cuigaosheng1 at huawei.com
Thu Nov 10 09:44:43 UTC 2022


The of_icc_get() function returns NULL or error pointers on error path,
so we should use IS_ERR_OR_NULL() to check the return value.

Fixes: 5ccdcecaf8f7 ("drm/msm: lookup the ICC paths in both mdp5/dpu and mdss devices")
Signed-off-by: Gaosheng Cui <cuigaosheng1 at huawei.com>
---
 drivers/gpu/drm/msm/msm_io_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c
index d02cd29ce829..950083b2f092 100644
--- a/drivers/gpu/drm/msm/msm_io_utils.c
+++ b/drivers/gpu/drm/msm/msm_io_utils.c
@@ -133,7 +133,7 @@ struct icc_path *msm_icc_get(struct device *dev, const char *name)
 	struct icc_path *path;
 
 	path = of_icc_get(dev, name);
-	if (path)
+	if (IS_ERR_OR_NULL(path))
 		return path;
 
 	/*
-- 
2.25.1



More information about the dri-devel mailing list