* [PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe @ 2022-04-08 10:21 ` Dan Carpenter 2022-04-12 1:01 ` Inki Dae 0 siblings, 1 reply; 4+ messages in thread From: Dan Carpenter @ 2022-04-08 10:21 UTC (permalink / raw) To: Inki Dae, Jagan Teki Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, kernel-janitors, Seung-Woo Kim, Kyungmin Park, Robert Foss, Krzysztof Kozlowski, dri-devel, Alim Akhtar, Marek Szyprowski 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 <dan.carpenter@oracle.com> --- -EPROBE_DEFER is the correct return, right? drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index 9e06f8e2a863..07e04ceb2476 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c @@ -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; } -- 2.20.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe 2022-04-08 10:21 ` [PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe Dan Carpenter @ 2022-04-12 1:01 ` Inki Dae 2022-04-12 4:19 ` Dan Carpenter 0 siblings, 1 reply; 4+ messages in thread From: Inki Dae @ 2022-04-12 1:01 UTC (permalink / raw) To: Dan Carpenter, Jagan Teki Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, kernel-janitors, Seung-Woo Kim, Kyungmin Park, Robert Foss, Krzysztof Kozlowski, dri-devel, Alim Akhtar, Marek Szyprowski Hi 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 이(가) 쓴 글: > 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 <dan.carpenter@oracle.com> > --- > -EPROBE_DEFER is the correct return, right? > > drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c > index 9e06f8e2a863..07e04ceb2476 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c > @@ -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; > } > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe 2022-04-12 1:01 ` Inki Dae @ 2022-04-12 4:19 ` Dan Carpenter 2022-04-20 8:08 ` Inki Dae 0 siblings, 1 reply; 4+ messages in thread From: Dan Carpenter @ 2022-04-12 4:19 UTC (permalink / raw) To: Inki Dae Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, kernel-janitors, dri-devel, Seung-Woo Kim, Krzysztof Kozlowski, Robert Foss, Kyungmin Park, Jagan Teki, Alim Akhtar, Marek Szyprowski On Tue, Apr 12, 2022 at 10:01:20AM +0900, Inki Dae wrote: > Hi Dan Carpenter. > > Same patch[1] was posted so I will pick it up. > > [1] https://www.spinics.net/lists/arm-kernel/msg967488.html > 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe 2022-04-12 4:19 ` Dan Carpenter @ 2022-04-20 8:08 ` Inki Dae 0 siblings, 0 replies; 4+ messages in thread From: Inki Dae @ 2022-04-20 8:08 UTC (permalink / raw) To: Dan Carpenter Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, kernel-janitors, dri-devel, Seung-Woo Kim, Krzysztof Kozlowski, Robert Foss, Kyungmin Park, Jagan Teki, Alim Akhtar, Marek Szyprowski Hi, 22. 4. 12. 13:19에 Dan Carpenter 이(가) 쓴 글: > On Tue, Apr 12, 2022 at 10:01:20AM +0900, Inki Dae wrote: >> Hi Dan Carpenter. >> >> Same patch[1] was posted so I will pick it up. >> >> [1] https://protect2.fireeye.com/v1/url?k=94e9d569-f562c05f-94e85e26-000babff9b5d-4d4f5b20cfffa24c&q=1&e=727c2c54-2082-4e0f-87d7-c6702bf4c81e&u=https%3A%2F%2Fwww.spinics.net%2Flists%2Farm-kernel%2Fmsg967488.html >> > > 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. > 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 이(가) 쓴 글: > If of_graph_get_remote_node() fails, it returns NULL pointer, replaces > IS_ERR() check with NULL pointer check. > > Fixes: dd8b6803bc49 ("exynos: drm: dsi: Attach in_bridge in MIC driver") > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > --- > drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c > index 9e06f8e2a863..43fc357a6682 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c > @@ -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? > regards, > dan carpenter > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-20 7:56 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20220408102327epcas1p409b13bf2da7e19b0a24571ce50e3ea92@epcas1p4.samsung.com> 2022-04-08 10:21 ` [PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe Dan Carpenter 2022-04-12 1:01 ` Inki Dae 2022-04-12 4:19 ` Dan Carpenter 2022-04-20 8:08 ` Inki Dae
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).