lkml.org 
[lkml]   [2016]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe()
From
Date
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))
>
>
>

\
 
 \ /
  Last update: 2016-09-17 09:59    [W:0.044 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site