All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe()
@ 2016-09-15  2:20 Wei Yongjun
  2016-09-16  2:10 ` Laura Abbott
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2016-09-15  2:20 UTC (permalink / raw)
  To: Laura Abbott, sumit.semwal, gregkh, arve, riandrews,
	bhaktipriya96, yudongbin, puck.chen
  Cc: Wei Yongjun, devel, linux-kernel

From: Wei Yongjun <weiyongjun1@huawei.com>

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

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/staging/android/ion/hisilicon/hi6220_ion.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
index f392db2..659aa71 100644
--- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
+++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
@@ -49,8 +49,8 @@ static int hi6220_ion_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, ipdev);
 
 	ipdev->idev = ion_device_create(NULL);
-	if (!ipdev->idev)
-		return -ENOMEM;
+	if (IS_ERR(ipdev->idev))
+		return PTR_ERR(ipdev->idev);
 
 	ipdev->data = ion_parse_dt(pdev, hisi_heaps);
 	if (IS_ERR(ipdev->data))

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

* Re: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe()
  2016-09-15  2:20 [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe() Wei Yongjun
@ 2016-09-16  2:10 ` Laura Abbott
  2016-09-16  2:25   ` Sumit Semwal
  0 siblings, 1 reply; 3+ messages in thread
From: Laura Abbott @ 2016-09-16  2:10 UTC (permalink / raw)
  To: Wei Yongjun, sumit.semwal, gregkh, arve, riandrews,
	bhaktipriya96, yudongbin, puck.chen
  Cc: Wei Yongjun, devel, linux-kernel

On 09/14/2016 07:20 PM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function ion_device_create() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
>

Acked-by: Laura Abbott <labbott@redhat.com>

> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/staging/android/ion/hisilicon/hi6220_ion.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
> index f392db2..659aa71 100644
> --- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
> +++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
> @@ -49,8 +49,8 @@ static int hi6220_ion_probe(struct platform_device *pdev)
>  	platform_set_drvdata(pdev, ipdev);
>
>  	ipdev->idev = ion_device_create(NULL);
> -	if (!ipdev->idev)
> -		return -ENOMEM;
> +	if (IS_ERR(ipdev->idev))
> +		return PTR_ERR(ipdev->idev);
>
>  	ipdev->data = ion_parse_dt(pdev, hisi_heaps);
>  	if (IS_ERR(ipdev->data))
>
>
>

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

* Re: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe()
  2016-09-16  2:10 ` Laura Abbott
@ 2016-09-16  2:25   ` Sumit Semwal
  0 siblings, 0 replies; 3+ messages in thread
From: Sumit Semwal @ 2016-09-16  2:25 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Wei Yongjun, Greg Kroah-Hartman, Arve Hj�nnev�g,
	Riley Andrews, bhaktipriya96, yudongbin, puck.chen, Wei Yongjun,
	devel, LKML

On 16 September 2016 at 07:40, Laura Abbott <labbott@redhat.com> wrote:
> On 09/14/2016 07:20 PM, Wei Yongjun wrote:
>>
>> From: Wei Yongjun <weiyongjun1@huawei.com>
>>
>> In case of error, the function ion_device_create() returns ERR_PTR() and
>> never returns NULL. The NULL test in the return value check should be
>> replaced with IS_ERR().
>>
>
> Acked-by: Laura Abbott <labbott@redhat.com>
>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
>
>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>> ---
>>  drivers/staging/android/ion/hisilicon/hi6220_ion.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
>> b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
>> index f392db2..659aa71 100644
>> --- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
>> +++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
>> @@ -49,8 +49,8 @@ static int hi6220_ion_probe(struct platform_device
>> *pdev)
>>         platform_set_drvdata(pdev, ipdev);
>>
>>         ipdev->idev = ion_device_create(NULL);
>> -       if (!ipdev->idev)
>> -               return -ENOMEM;
>> +       if (IS_ERR(ipdev->idev))
>> +               return PTR_ERR(ipdev->idev);
>>
>>         ipdev->data = ion_parse_dt(pdev, hisi_heaps);
>>         if (IS_ERR(ipdev->data))
>>
>>
>>
>



-- 
Thanks and regards,

Sumit Semwal
Linaro Mobile Group - Kernel Team Lead
Linaro.org │ Open source software for ARM SoCs

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

end of thread, other threads:[~2016-09-16  2:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15  2:20 [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe() Wei Yongjun
2016-09-16  2:10 ` Laura Abbott
2016-09-16  2:25   ` Sumit Semwal

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.