drm/exynos: fix IS_ERR() vs NULL check in probe
Subsystems (4)
PATCH 1/1 drm/exynos: fix IS_ERR() vs NULL check in probe
The of_drm_find_bridge() does not return error pointers, it returns NULL on error.
---
-EPROBE_DEFER is the correct return, right?
drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_mic.c +2 -2
@@ -434,9 +434,9 @@ static int exynos_mic_probe(struct platform_device *pdev) remote =of_graph_get_remote_node (dev->of_node,1 ,0 ); mic->next_bridge =of_drm_find_bridge (remote); -if (IS_ERR (mic->next_bridge)) { +if (!mic->next_bridge) {DRM_DEV_ERROR (dev,"mic: Failed to find next bridge\n" ); - ret =PTR_ERR (mic->next_bridge); + ret = -EPROBE_DEFER ; goto err; }
Signature · 1 line
2.20.1
Inki Dae
maintainerHi Dan Carpenter.
Same patch[1] was posted so I will pick it up.
[1] https://www.spinics.net/lists/arm-kernel/msg967488.html
Thanks,
Inki Dae
22. 4. 8. 19:21에 Dan Carpenter 이(가) 쓴 글:
Quoted 27 lines
The
of_drm_find_bridge()does not return error pointers, it returns NULL on error.Fixes dd8b6803bc49 ("exynos: drm: dsi: Attach in_bridge in MIC driver")Signed-off-by Dan Carpenter <[email protected]>---
(quoted diff) +0
-1-EPROBE_DEFER is the correct return, right? drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_drm_mic.c +2
-2@@ -434,9 +434,9 @@ static int exynos_mic_probe(struct platform_device *pdev) remote =of_graph_get_remote_node (dev->of_node,1 ,0 ); mic->next_bridge =of_drm_find_bridge (remote); -if (IS_ERR (mic->next_bridge)) { +if (!mic->next_bridge) {DRM_DEV_ERROR (dev,"mic: Failed to find next bridge\n" ); - ret =PTR_ERR (mic->next_bridge); + ret = -EPROBE_DEFER ; goto err; }
Quoted 6 lines · Inki Dae
Hi Dan Carpenter.
Same patch[1] was posted so I will pick it up.
It's not the same. That one returns -EINVAL and mine returns -EPROBE_DEFER. I obvoiously thought that -EPROBE_DEFER was the correct return but I wasn't positive. -EPROBE_DEFER is kind of a special return so I think it matters to get this correct.
regards,
dan carpenter
Inki Dae
maintainerHi,
22. 4. 12. 13:19에 Dan Carpenter 이(가) 쓴 글:
Quoted 5 lines · Inki Dae
Quoted 4 lines
Hi Dan Carpenter.
Same patch[1] was posted so I will pick it up.
Quoted 8 lines
It's not the same. That one returns
-EINVALand mine returns -EPROBE_DEFER. I obvoiously thought that -EPROBE_DEFER was the correct return but I wasn't positive. -EPROBE_DEFER is kind of a special return so I think it matters to get this correct.
Correct so I requested[1] him to fix it but the delivery failed. :( I will just pick your patch up. :) [Delivery Failure] Re: [PATCH -next] drm/exynos: mic: fix return value check in exynos_mic_probe().
[1] My email sent below,
--------------------
22. 4. 6. 18:22에 Yang Yingliang 이(가) 쓴 글:
Review
Quoted 11 lines
If
of_graph_get_remote_node()fails, it returns NULL pointer, replacesIS_ERR()check with NULL pointer check.Fixes dd8b6803bc49 ("exynos: drm: dsi: Attach in_bridge in MIC driver")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>---
drivers/gpu/drm/exynos/exynos_drm_mic.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_mic.c
drivers/gpu/drm/exynos/exynos_drm_mic.c static int exynos_mic_probe(struct platform_device *pdev) · line 439
Quoted 12 lines
index
9e06f8e2a863..43fc357a6682100644drivers/gpu/drm/exynos/exynos_drm_mic.c +2
-2@@ -434,9 +434,9 @@ static int exynos_mic_probe(struct platform_device *pdev) remote =of_graph_get_remote_node (dev->of_node,1 ,0 ); mic->next_bridge =of_drm_find_bridge (remote); -if (IS_ERR (mic->next_bridge)) { +if (!mic->next_bridge) {DRM_DEV_ERROR (dev,"mic: Failed to find next bridge\n" ); - ret =PTR_ERR (mic->next_bridge); + ret = -EINVAL ;
-EPROBE_DEFER should be returned instead. Could you modify and resend it again?
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_mic.c +0
-0regards,dan carpenter