All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-06 12:15 ` weiyj_lk at 163.com
  0 siblings, 0 replies; 23+ messages in thread
From: weiyj_lk @ 2016-07-06 12:15 UTC (permalink / raw)
  To: Marek Szyprowski, Joerg Roedel, Kukjin Kim, Krzysztof Kozlowski
  Cc: Wei Yongjun, iommu, linux-arm-kernel, linux-samsung-soc

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29..9b23059 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENOMEM;
 
 	/*
 	 * use the first registered sysmmu device for performing

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

* [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-06 12:15 ` weiyj_lk at 163.com
  0 siblings, 0 replies; 23+ messages in thread
From: weiyj_lk at 163.com @ 2016-07-06 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29..9b23059 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENOMEM;
 
 	/*
 	 * use the first registered sysmmu device for performing

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

* Re: [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-06 12:15 ` weiyj_lk at 163.com
@ 2016-07-06 12:47   ` Dennis Chen
  -1 siblings, 0 replies; 23+ messages in thread
From: Dennis Chen @ 2016-07-06 12:47 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Marek Szyprowski, Joerg Roedel, Kukjin Kim, Krzysztof Kozlowski,
	Wei Yongjun, linux-samsung-soc, iommu, linux-arm-kernel

On Wed, Jul 06, 2016 at 12:15:54PM +0000, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 33dcc29..9b23059 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>               exynos_iommu_init();
>
>       pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> -     if (IS_ERR(pdev))
> -             return PTR_ERR(pdev);
> +     if (!pdev)
> +             return -ENOMEM;
>
Indeed!If of_platform_device_create only returns NULL in case of failure, then IS_ERR() will be
false, so
Reviewed-by: Dennis Chen <dennis.chen@arm.com>

Thanks,
Dennis
>
>       /*
>        * use the first registered sysmmu device for performing
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-06 12:47   ` Dennis Chen
  0 siblings, 0 replies; 23+ messages in thread
From: Dennis Chen @ 2016-07-06 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 06, 2016 at 12:15:54PM +0000, weiyj_lk at 163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 33dcc29..9b23059 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>               exynos_iommu_init();
>
>       pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> -     if (IS_ERR(pdev))
> -             return PTR_ERR(pdev);
> +     if (!pdev)
> +             return -ENOMEM;
>
Indeed!If of_platform_device_create only returns NULL in case of failure, then IS_ERR() will be
false, so
Reviewed-by: Dennis Chen <dennis.chen@arm.com>

Thanks,
Dennis
>
>       /*
>        * use the first registered sysmmu device for performing
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-06 12:15 ` weiyj_lk at 163.com
@ 2016-07-06 13:09   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2016-07-06 13:09 UTC (permalink / raw)
  To: weiyj_lk, Marek Szyprowski, Joerg Roedel, Kukjin Kim
  Cc: Wei Yongjun, iommu, linux-arm-kernel, linux-samsung-soc

On 07/06/2016 02:15 PM, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 33dcc29..9b23059 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>  		exynos_iommu_init();
>  
>  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> -	if (IS_ERR(pdev))
> -		return PTR_ERR(pdev);
> +	if (!pdev)
> +		return -ENOMEM;
>  
>  	/*
>  	 * use the first registered sysmmu device for performing
> 

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>


Which in case of first sysmmu device and of_platform_device_create()
failure will lead to NULL pointer exception, so I think it is
appropriate to:
Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback
instead of initcall")
Cc: <stable@vger.kernel.org>

Best regards,
Krzysztof

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

* [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-06 13:09   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2016-07-06 13:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/06/2016 02:15 PM, weiyj_lk at 163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 33dcc29..9b23059 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>  		exynos_iommu_init();
>  
>  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> -	if (IS_ERR(pdev))
> -		return PTR_ERR(pdev);
> +	if (!pdev)
> +		return -ENOMEM;
>  
>  	/*
>  	 * use the first registered sysmmu device for performing
> 

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>


Which in case of first sysmmu device and of_platform_device_create()
failure will lead to NULL pointer exception, so I think it is
appropriate to:
Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback
instead of initcall")
Cc: <stable@vger.kernel.org>

Best regards,
Krzysztof

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

* Re: [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-06 13:09   ` Krzysztof Kozlowski
@ 2016-07-07  2:34     ` Andi Shyti
  -1 siblings, 0 replies; 23+ messages in thread
From: Andi Shyti @ 2016-07-07  2:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: weiyj_lk, Marek Szyprowski, Joerg Roedel, Kukjin Kim,
	Wei Yongjun, iommu, linux-arm-kernel, linux-samsung-soc

Hi,

just a question,

> >  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> > -	if (IS_ERR(pdev))
> > -		return PTR_ERR(pdev);
> > +	if (!pdev)
> > +		return -ENOMEM;
> >  
> >  	/*
> >  	 * use the first registered sysmmu device for performing
> > 
> 

is ENOMEM the right return value? of_platform_device_create()
doesn't fail only in case of malloc failure.

Shouldn't it be ENODEV instead, which might also mean with some
imagination that there is no memory available for that device?

Thanks,
Andi

> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

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

* [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07  2:34     ` Andi Shyti
  0 siblings, 0 replies; 23+ messages in thread
From: Andi Shyti @ 2016-07-07  2:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

just a question,

> >  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> > -	if (IS_ERR(pdev))
> > -		return PTR_ERR(pdev);
> > +	if (!pdev)
> > +		return -ENOMEM;
> >  
> >  	/*
> >  	 * use the first registered sysmmu device for performing
> > 
> 

is ENOMEM the right return value? of_platform_device_create()
doesn't fail only in case of malloc failure.

Shouldn't it be ENODEV instead, which might also mean with some
imagination that there is no memory available for that device?

Thanks,
Andi

> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

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

* Re: [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-07  2:34     ` Andi Shyti
@ 2016-07-07  2:50       ` Wei Yongjun
  -1 siblings, 0 replies; 23+ messages in thread
From: Wei Yongjun @ 2016-07-07  2:50 UTC (permalink / raw)
  To: Andi Shyti, Krzysztof Kozlowski
  Cc: Marek Szyprowski, Joerg Roedel, Kukjin Kim, Wei Yongjun, iommu,
	linux-arm-kernel, linux-samsung-soc

Hi,

> just a question,
>
>>>  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
>>> -	if (IS_ERR(pdev))
>>> -		return PTR_ERR(pdev);
>>> +	if (!pdev)
>>> +		return -ENOMEM;
>>>  
>>>  	/*
>>>  	 * use the first registered sysmmu device for performing
>>>
> is ENOMEM the right return value? of_platform_device_create()
> doesn't fail only in case of malloc failure.
>
> Shouldn't it be ENODEV instead, which might also mean with some
> imagination that there is no memory available for that device?
>
Your are right, I will change the error to -ENODEV and resend the patch.

Thanks,
Wei Yongjun

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

* [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07  2:50       ` Wei Yongjun
  0 siblings, 0 replies; 23+ messages in thread
From: Wei Yongjun @ 2016-07-07  2:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

> just a question,
>
>>>  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
>>> -	if (IS_ERR(pdev))
>>> -		return PTR_ERR(pdev);
>>> +	if (!pdev)
>>> +		return -ENOMEM;
>>>  
>>>  	/*
>>>  	 * use the first registered sysmmu device for performing
>>>
> is ENOMEM the right return value? of_platform_device_create()
> doesn't fail only in case of malloc failure.
>
> Shouldn't it be ENODEV instead, which might also mean with some
> imagination that there is no memory available for that device?
>
Your are right, I will change the error to -ENODEV and resend the patch.

Thanks,
Wei Yongjun

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

* [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-06 12:15 ` weiyj_lk at 163.com
@ 2016-07-07  2:59     ` weiyj_lk at 163.com
  -1 siblings, 0 replies; 23+ messages in thread
From: weiyj_lk-9Onoh4P/yGk @ 2016-07-07  2:59 UTC (permalink / raw)
  To: Marek Szyprowski, Joerg Roedel, Kukjin Kim, Krzysztof Kozlowski
  Cc: Wei Yongjun, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

In case of error, the function of_platform_device_create() 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 <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
v1 -> v2: chenge the error code to -ENODEV
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29..9b23059 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENODEV;
 
 	/*
 	 * use the first registered sysmmu device for performing

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

* [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07  2:59     ` weiyj_lk at 163.com
  0 siblings, 0 replies; 23+ messages in thread
From: weiyj_lk at 163.com @ 2016-07-07  2:59 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
---
v1 -> v2: chenge the error code to -ENODEV
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29..9b23059 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENODEV;
 
 	/*
 	 * use the first registered sysmmu device for performing

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

* Re: [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-07  2:59     ` weiyj_lk at 163.com
@ 2016-07-07  4:25       ` Andi Shyti
  -1 siblings, 0 replies; 23+ messages in thread
From: Andi Shyti @ 2016-07-07  4:25 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Marek Szyprowski, Joerg Roedel, Kukjin Kim, Krzysztof Kozlowski,
	Wei Yongjun, iommu, linux-arm-kernel, linux-samsung-soc

Hi Wei,

On Thu, Jul 07, 2016 at 02:59:32AM +0000, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Andi Shyti <andi.shyti@samsung.com>

Thanks,
Andi

> ---
> v1 -> v2: chenge the error code to -ENODEV
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 33dcc29..9b23059 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>  		exynos_iommu_init();
>  
>  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> -	if (IS_ERR(pdev))
> -		return PTR_ERR(pdev);
> +	if (!pdev)
> +		return -ENODEV;
>  
>  	/*
>  	 * use the first registered sysmmu device for performing
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07  4:25       ` Andi Shyti
  0 siblings, 0 replies; 23+ messages in thread
From: Andi Shyti @ 2016-07-07  4:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Wei,

On Thu, Jul 07, 2016 at 02:59:32AM +0000, weiyj_lk at 163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Andi Shyti <andi.shyti@samsung.com>

Thanks,
Andi

> ---
> v1 -> v2: chenge the error code to -ENODEV
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 33dcc29..9b23059 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>  		exynos_iommu_init();
>  
>  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> -	if (IS_ERR(pdev))
> -		return PTR_ERR(pdev);
> +	if (!pdev)
> +		return -ENODEV;
>  
>  	/*
>  	 * use the first registered sysmmu device for performing
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-07  2:59     ` weiyj_lk at 163.com
@ 2016-07-07  9:43         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2016-07-07  9:43 UTC (permalink / raw)
  To: weiyj_lk-9Onoh4P/yGk, Marek Szyprowski, Joerg Roedel, Kukjin Kim
  Cc: Wei Yongjun, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 07/07/2016 04:59 AM, weiyj_lk-9Onoh4P/yGk@public.gmane.org wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> 
> In case of error, the function of_platform_device_create() 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 <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> ---
> v1 -> v2: chenge the error code to -ENODEV
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Why you didn't include mine and Dennis reviews? Why you ignored my
comments - you don't agree with them?

Best regards,
Krzysztof

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

* [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07  9:43         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2016-07-07  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/07/2016 04:59 AM, weiyj_lk at 163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
> ---
> v1 -> v2: chenge the error code to -ENODEV
> ---
>  drivers/iommu/exynos-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Why you didn't include mine and Dennis reviews? Why you ignored my
comments - you don't agree with them?

Best regards,
Krzysztof

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

* Re: [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-07  9:43         ` Krzysztof Kozlowski
@ 2016-07-07 12:09           ` Wei Yongjun
  -1 siblings, 0 replies; 23+ messages in thread
From: Wei Yongjun @ 2016-07-07 12:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Marek Szyprowski, Joerg Roedel, Kukjin Kim
  Cc: Wei Yongjun, linux-samsung-soc, iommu, linux-arm-kernel

On 07/07/2016 05:43 PM, Krzysztof Kozlowski wrote:
> On 07/07/2016 04:59 AM, weiyj_lk@163.com wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
>> ---
>> v1 -> v2: chenge the error code to -ENODEV
>> ---
>>   drivers/iommu/exynos-iommu.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
> Why you didn't include mine and Dennis reviews? Why you ignored my
> comments - you don't agree with them?
>
Sorry, I missed your last mail. I will change patch as your advise.

Regards,
Yongjun Wei

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

* [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07 12:09           ` Wei Yongjun
  0 siblings, 0 replies; 23+ messages in thread
From: Wei Yongjun @ 2016-07-07 12:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/07/2016 05:43 PM, Krzysztof Kozlowski wrote:
> On 07/07/2016 04:59 AM, weiyj_lk at 163.com wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
>> ---
>> v1 -> v2: chenge the error code to -ENODEV
>> ---
>>   drivers/iommu/exynos-iommu.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
> Why you didn't include mine and Dennis reviews? Why you ignored my
> comments - you don't agree with them?
>
Sorry, I missed your last mail. I will change patch as your advise.

Regards,
Yongjun Wei

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

* [PATCH -next v3] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
       [not found]     ` <1467860372-6940-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
  2016-07-07  9:43         ` Krzysztof Kozlowski
@ 2016-07-07 12:17       ` weiyj_lk-9Onoh4P/yGk
  0 siblings, 0 replies; 23+ messages in thread
From: weiyj_lk @ 2016-07-07 12:17 UTC (permalink / raw)
  To: Marek Szyprowski, Joerg Roedel, Kukjin Kim, Krzysztof Kozlowski,
	Dennis Chen, Andi Shyti
  Cc: Wei Yongjun, iommu, linux-arm-kernel, linux-samsung-soc, stable

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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

Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback
instead of initcall")
Cc: stable@vger.kernel.org
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Dennis Chen <dennis.chen@arm.com>
---
v2 -> v3: added fixes and Reviewed-by.
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29..9b23059 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENODEV;
 
 	/*
 	 * use the first registered sysmmu device for performing



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

* [PATCH -next v3] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07 12:17       ` weiyj_lk-9Onoh4P/yGk
  0 siblings, 0 replies; 23+ messages in thread
From: weiyj_lk-9Onoh4P/yGk @ 2016-07-07 12:17 UTC (permalink / raw)
  To: Marek Szyprowski, Joerg Roedel, Kukjin Kim, Krzysztof Kozlowski,
	Dennis Chen, Andi Shyti
  Cc: stable-u79uwXL29TY76Z2rM5mHXA, Wei Yongjun,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

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

Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback
instead of initcall")
Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
Reviewed-by: Andi Shyti <andi.shyti-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Reviewed-by: Dennis Chen <dennis.chen-5wv7dgnIgG8@public.gmane.org>
---
v2 -> v3: added fixes and Reviewed-by.
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29..9b23059 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENODEV;
 
 	/*
 	 * use the first registered sysmmu device for performing

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

* [PATCH -next v3] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-07 12:17       ` weiyj_lk-9Onoh4P/yGk
  0 siblings, 0 replies; 23+ messages in thread
From: weiyj_lk at 163.com @ 2016-07-07 12:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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

Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback
instead of initcall")
Cc: stable at vger.kernel.org
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Dennis Chen <dennis.chen@arm.com>
---
v2 -> v3: added fixes and Reviewed-by.
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29..9b23059 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENODEV;
 
 	/*
 	 * use the first registered sysmmu device for performing

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

* Re: [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
  2016-07-06 13:09   ` Krzysztof Kozlowski
@ 2016-07-18  7:34     ` Marek Szyprowski
  -1 siblings, 0 replies; 23+ messages in thread
From: Marek Szyprowski @ 2016-07-18  7:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski, weiyj_lk, Joerg Roedel, Kukjin Kim
  Cc: Wei Yongjun, iommu, linux-arm-kernel, linux-samsung-soc

Hello,


On 2016-07-06 15:09, Krzysztof Kozlowski wrote:
> On 07/06/2016 02:15 PM, weiyj_lk@163.com wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
>> ---
>>   drivers/iommu/exynos-iommu.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
>> index 33dcc29..9b23059 100644
>> --- a/drivers/iommu/exynos-iommu.c
>> +++ b/drivers/iommu/exynos-iommu.c
>> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>>   		exynos_iommu_init();
>>   
>>   	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
>> -	if (IS_ERR(pdev))
>> -		return PTR_ERR(pdev);
>> +	if (!pdev)
>> +		return -ENOMEM;
>>   
>>   	/*
>>   	 * use the first registered sysmmu device for performing
>>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>
>
> Which in case of first sysmmu device and of_platform_device_create()
> failure will lead to NULL pointer exception, so I think it is
> appropriate to:
> Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback
> instead of initcall")
> Cc: <stable@vger.kernel.org>

Thanks for spotting this issue.

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup()
@ 2016-07-18  7:34     ` Marek Szyprowski
  0 siblings, 0 replies; 23+ messages in thread
From: Marek Szyprowski @ 2016-07-18  7:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,


On 2016-07-06 15:09, Krzysztof Kozlowski wrote:
> On 07/06/2016 02:15 PM, weiyj_lk at 163.com wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> In case of error, the function of_platform_device_create() 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 <yongjun_wei@trendmicro.com.cn>
>> ---
>>   drivers/iommu/exynos-iommu.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
>> index 33dcc29..9b23059 100644
>> --- a/drivers/iommu/exynos-iommu.c
>> +++ b/drivers/iommu/exynos-iommu.c
>> @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
>>   		exynos_iommu_init();
>>   
>>   	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
>> -	if (IS_ERR(pdev))
>> -		return PTR_ERR(pdev);
>> +	if (!pdev)
>> +		return -ENOMEM;
>>   
>>   	/*
>>   	 * use the first registered sysmmu device for performing
>>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>
>
> Which in case of first sysmmu device and of_platform_device_create()
> failure will lead to NULL pointer exception, so I think it is
> appropriate to:
> Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback
> instead of initcall")
> Cc: <stable@vger.kernel.org>

Thanks for spotting this issue.

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

end of thread, other threads:[~2016-07-18  7:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-06 12:15 [PATCH -next] iommu/exynos: Fix return value check in exynos_iommu_of_setup() weiyj_lk
2016-07-06 12:15 ` weiyj_lk at 163.com
2016-07-06 12:47 ` Dennis Chen
2016-07-06 12:47   ` Dennis Chen
2016-07-06 13:09 ` Krzysztof Kozlowski
2016-07-06 13:09   ` Krzysztof Kozlowski
2016-07-07  2:34   ` Andi Shyti
2016-07-07  2:34     ` Andi Shyti
2016-07-07  2:50     ` Wei Yongjun
2016-07-07  2:50       ` Wei Yongjun
2016-07-18  7:34   ` Marek Szyprowski
2016-07-18  7:34     ` Marek Szyprowski
     [not found] ` <1467807354-26503-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
2016-07-07  2:59   ` [PATCH -next v2] " weiyj_lk-9Onoh4P/yGk
2016-07-07  2:59     ` weiyj_lk at 163.com
2016-07-07  4:25     ` Andi Shyti
2016-07-07  4:25       ` Andi Shyti
     [not found]     ` <1467860372-6940-1-git-send-email-weiyj_lk-9Onoh4P/yGk@public.gmane.org>
2016-07-07  9:43       ` Krzysztof Kozlowski
2016-07-07  9:43         ` Krzysztof Kozlowski
2016-07-07 12:09         ` Wei Yongjun
2016-07-07 12:09           ` Wei Yongjun
2016-07-07 12:17     ` [PATCH -next v3] " weiyj_lk
2016-07-07 12:17       ` weiyj_lk at 163.com
2016-07-07 12:17       ` weiyj_lk-9Onoh4P/yGk

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.