From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757323AbcIPCZp (ORCPT ); Thu, 15 Sep 2016 22:25:45 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:34777 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755100AbcIPCZm (ORCPT ); Thu, 15 Sep 2016 22:25:42 -0400 MIME-Version: 1.0 In-Reply-To: <9086e07b-ba40-545f-fbc2-8950d973929f@redhat.com> References: <1473906043-28683-1-git-send-email-weiyj.lk@gmail.com> <9086e07b-ba40-545f-fbc2-8950d973929f@redhat.com> From: Sumit Semwal Date: Fri, 16 Sep 2016 07:55:20 +0530 Message-ID: Subject: Re: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe() To: Laura Abbott Cc: Wei Yongjun , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIau+/vW5uZXbvv71n?= , Riley Andrews , bhaktipriya96@gmail.com, yudongbin@hisilicon.com, puck.chen@hisilicon.com, Wei Yongjun , devel@driverdev.osuosl.org, LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u8G2PoMq009548 On 16 September 2016 at 07:40, Laura Abbott wrote: > On 09/14/2016 07:20 PM, Wei Yongjun wrote: >> >> From: Wei Yongjun >> >> 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 > Reviewed-by: Sumit Semwal > >> Signed-off-by: Wei Yongjun >> --- >> 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