All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Fix return value check in kirin_drm_platform_probe()
@ 2017-10-11 11:17 ` Wei Yongjun
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yongjun @ 2017-10-11 11:17 UTC (permalink / raw)
  To: Xinliang Liu, zourongrong, kong.kongxinwei, puck.chen, airlied,
	robh, rmk+kernel, treding, arnd, daniel.vetter, seanpaul,
	krisman, jsarha, noralf
  Cc: Wei Yongjun, dri-devel, linux-kernel

In case of error, the function of_graph_get_remote_node() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test..

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index e27352c..527aa58 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -236,8 +236,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
 	}
 
 	remote = of_graph_get_remote_node(np, 0, 0);
-	if (IS_ERR(remote))
-		return PTR_ERR(remote);
+	if (!remote)
+		return -ENODEV;
 
 	drm_of_component_match_add(dev, &match, compare_of, remote);
 	of_node_put(remote);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] drm: Fix return value check in kirin_drm_platform_probe()
@ 2017-10-11 11:17 ` Wei Yongjun
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yongjun @ 2017-10-11 11:17 UTC (permalink / raw)
  To: Xinliang Liu, zourongrong, kong.kongxinwei, puck.chen, airlied,
	robh, rmk+kernel, treding, arnd, daniel.vetter, seanpaul,
	krisman, jsarha, noralf
  Cc: Wei Yongjun, dri-devel, linux-kernel

In case of error, the function of_graph_get_remote_node() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test..

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index e27352c..527aa58 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -236,8 +236,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
 	}
 
 	remote = of_graph_get_remote_node(np, 0, 0);
-	if (IS_ERR(remote))
-		return PTR_ERR(remote);
+	if (!remote)
+		return -ENODEV;
 
 	drm_of_component_match_add(dev, &match, compare_of, remote);
 	of_node_put(remote);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: Fix return value check in kirin_drm_platform_probe()
  2017-10-11 11:17 ` Wei Yongjun
@ 2017-10-11 17:30   ` Sean Paul
  -1 siblings, 0 replies; 7+ messages in thread
From: Sean Paul @ 2017-10-11 17:30 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Xinliang Liu, zourongrong, kong.kongxinwei, puck.chen, airlied,
	robh, rmk+kernel, treding, arnd, daniel.vetter, seanpaul,
	krisman, jsarha, noralf, dri-devel, linux-kernel

On Wed, Oct 11, 2017 at 11:17:16AM +0000, Wei Yongjun wrote:
> In case of error, the function of_graph_get_remote_node() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test..
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index e27352c..527aa58 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -236,8 +236,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
>  	}
>  
>  	remote = of_graph_get_remote_node(np, 0, 0);
> -	if (IS_ERR(remote))
> -		return PTR_ERR(remote);
> +	if (!remote)
> +		return -ENODEV;
>  
>  	drm_of_component_match_add(dev, &match, compare_of, remote);
>  	of_node_put(remote);
> 
> 
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: Fix return value check in kirin_drm_platform_probe()
@ 2017-10-11 17:30   ` Sean Paul
  0 siblings, 0 replies; 7+ messages in thread
From: Sean Paul @ 2017-10-11 17:30 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: arnd, puck.chen, rmk+kernel, jsarha, linux-kernel, Xinliang Liu,
	kong.kongxinwei, dri-devel, daniel.vetter, zourongrong, treding,
	krisman

On Wed, Oct 11, 2017 at 11:17:16AM +0000, Wei Yongjun wrote:
> In case of error, the function of_graph_get_remote_node() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test..
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index e27352c..527aa58 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -236,8 +236,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
>  	}
>  
>  	remote = of_graph_get_remote_node(np, 0, 0);
> -	if (IS_ERR(remote))
> -		return PTR_ERR(remote);
> +	if (!remote)
> +		return -ENODEV;
>  
>  	drm_of_component_match_add(dev, &match, compare_of, remote);
>  	of_node_put(remote);
> 
> 
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: Fix return value check in kirin_drm_platform_probe()
  2017-10-11 11:17 ` Wei Yongjun
@ 2017-10-12  6:39   ` Gabriel Krisman Bertazi
  -1 siblings, 0 replies; 7+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-10-12  6:39 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Xinliang Liu, zourongrong, kong.kongxinwei, puck.chen, airlied,
	robh, rmk+kernel, treding, arnd, daniel.vetter, seanpaul, jsarha,
	noralf, dri-devel, linux-kernel

Wei Yongjun <weiyongjun1@huawei.com> writes:

> In case of error, the function of_graph_get_remote_node() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test..

Looks good.

Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

-- 
Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: Fix return value check in kirin_drm_platform_probe()
@ 2017-10-12  6:39   ` Gabriel Krisman Bertazi
  0 siblings, 0 replies; 7+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-10-12  6:39 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Xinliang Liu, zourongrong, kong.kongxinwei, puck.chen, airlied,
	robh, rmk+kernel, treding, arnd, daniel.vetter, seanpaul, jsarha,
	noralf, dri-devel, linux-kernel

Wei Yongjun <weiyongjun1@huawei.com> writes:

> In case of error, the function of_graph_get_remote_node() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test..

Looks good.

Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

-- 
Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: Fix return value check in kirin_drm_platform_probe()
  2017-10-12  6:39   ` Gabriel Krisman Bertazi
  (?)
@ 2017-10-12 14:42   ` Sean Paul
  -1 siblings, 0 replies; 7+ messages in thread
From: Sean Paul @ 2017-10-12 14:42 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi
  Cc: Wei Yongjun, Xinliang Liu, Rongrong Zou, Xinwei Kong, Chen Feng,
	Dave Airlie, Rob Herring, Russell King, Thierry Reding,
	Arnd Bergmann, Daniel Vetter, Jyri Sarha, noralf, dri-devel,
	Linux Kernel Mailing List, Dan Carpenter

On Thu, Oct 12, 2017 at 2:39 AM, Gabriel Krisman Bertazi
<krisman@collabora.co.uk> wrote:
> Wei Yongjun <weiyongjun1@huawei.com> writes:
>
>> In case of error, the function of_graph_get_remote_node() returns NULL
>> pointer not ERR_PTR(). The IS_ERR() test in the return value check
>> should be replaced with NULL test..
>
> Looks good.
>
> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>

FYI, I just noticed Dan Carpenter sent an identical patch last week
"<20171005125751.jvtjms62vbtxuvak@mwanda> [PATCH] drm/kirin: Checking
for IS_ERR() instead of NULL".

I'll add my R-b there, since it was first.

Sean


> --
> Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-12 14:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-11 11:17 [PATCH] drm: Fix return value check in kirin_drm_platform_probe() Wei Yongjun
2017-10-11 11:17 ` Wei Yongjun
2017-10-11 17:30 ` Sean Paul
2017-10-11 17:30   ` Sean Paul
2017-10-12  6:39 ` Gabriel Krisman Bertazi
2017-10-12  6:39   ` Gabriel Krisman Bertazi
2017-10-12 14:42   ` Sean Paul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.