From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755403AbdEEDdm (ORCPT ); Thu, 4 May 2017 23:33:42 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5862 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbdEEDdl (ORCPT ); Thu, 4 May 2017 23:33:41 -0400 Subject: Re: [PATCH] ion: hisilicon: check the right value after ion_heap_create To: Laura Abbott , Yisheng Xie , , , , , References: <1493909133-3868-1-git-send-email-ysxie@foxmail.com> <43fbdb96-78ed-2429-2ead-e79081b2a6fb@redhat.com> CC: , From: Yisheng Xie Message-ID: <6d0407c8-dea4-1b60-772b-304632f49486@huawei.com> Date: Fri, 5 May 2017 11:32:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <43fbdb96-78ed-2429-2ead-e79081b2a6fb@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.40] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.590BF282.002F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 2a7b8f298f9f3c441b2f05892a1c8d81 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laura, On 2017/5/5 1:47, Laura Abbott wrote: > On 05/04/2017 07:45 AM, Yisheng Xie wrote: >> From: Yisheng Xie >> >> It should check ipdev->heaps[i] whether it is error or null instead of >> ipdev->heaps, after ion_heap_create() for ipdev->heaps[i]. >> >> Signed-off-by: Yisheng Xie >> --- >> drivers/staging/android/ion/hisilicon/hi6220_ion.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c >> index 0de7897..7f8eda5 100644 >> --- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c >> +++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c >> @@ -66,7 +66,7 @@ static int hi6220_ion_probe(struct platform_device *pdev) >> >> for (i = 0; i < ipdev->data->nr; i++) { >> ipdev->heaps[i] = ion_heap_create(&ipdev->data->heaps[i]); >> - if (!ipdev->heaps) { >> + if (IS_ERR_OR_NULL(ipdev->heaps[i])) { >> ion_destroy_platform_data(ipdev->data); >> return -ENOMEM; >> } >> > > This file was removed in a recent clean up series. I see, but maybe you should clean up more totally, I mean you should also remove ./drivers/staging/android/ion/devicetree.txt for it is also useless. Thanks Yisheng Xie