Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1635838 > unrolled thread

[PATCH] ion: hisilicon: check the right value after ion_heap_create

Started byYisheng Xie <ysxie@foxmail.com>
First post2017-05-04 17:30 +0200
Last post2017-05-05 17:50 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ion: hisilicon: check the right value after ion_heap_create Yisheng Xie <ysxie@foxmail.com> - 2017-05-04 17:30 +0200
    Re: [PATCH] ion: hisilicon: check the right value after  ion_heap_create Laura Abbott <labbott@redhat.com> - 2017-05-04 19:50 +0200
      Re: [PATCH] ion: hisilicon: check the right value after  ion_heap_create Yisheng Xie <xieyisheng1@huawei.com> - 2017-05-05 05:40 +0200
        Re: [PATCH] ion: hisilicon: check the right value after  ion_heap_create Laura Abbott <labbott@redhat.com> - 2017-05-05 17:50 +0200

#1635838 — [PATCH] ion: hisilicon: check the right value after ion_heap_create

FromYisheng Xie <ysxie@foxmail.com>
Date2017-05-04 17:30 +0200
Subject[PATCH] ion: hisilicon: check the right value after ion_heap_create
Message-ID<tDqRz-5hr-1@gated-at.bofh.it>
From: Yisheng Xie <xieyisheng1@huawei.com>

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 <xieyisheng1@huawei.com>
---
 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;
 		}
-- 
1.9.1

[toc] | [next] | [standalone]


#1635940 — Re: [PATCH] ion: hisilicon: check the right value after ion_heap_create

FromLaura Abbott <labbott@redhat.com>
Date2017-05-04 19:50 +0200
SubjectRe: [PATCH] ion: hisilicon: check the right value after ion_heap_create
Message-ID<tDt34-6JH-31@gated-at.bofh.it>
In reply to#1635838
On 05/04/2017 07:45 AM, Yisheng Xie wrote:
> From: Yisheng Xie <xieyisheng1@huawei.com>
> 
> 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 <xieyisheng1@huawei.com>
> ---
>  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.

Thanks,
Laura

[toc] | [prev] | [next] | [standalone]


#1636142 — Re: [PATCH] ion: hisilicon: check the right value after ion_heap_create

FromYisheng Xie <xieyisheng1@huawei.com>
Date2017-05-05 05:40 +0200
SubjectRe: [PATCH] ion: hisilicon: check the right value after ion_heap_create
Message-ID<tDCg1-4wN-1@gated-at.bofh.it>
In reply to#1635940
Hi Laura,

On 2017/5/5 1:47, Laura Abbott wrote:
> On 05/04/2017 07:45 AM, Yisheng Xie wrote:
>> From: Yisheng Xie <xieyisheng1@huawei.com>
>>
>> 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 <xieyisheng1@huawei.com>
>> ---
>>  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

[toc] | [prev] | [next] | [standalone]


#1636465 — Re: [PATCH] ion: hisilicon: check the right value after ion_heap_create

FromLaura Abbott <labbott@redhat.com>
Date2017-05-05 17:50 +0200
SubjectRe: [PATCH] ion: hisilicon: check the right value after ion_heap_create
Message-ID<tDNEt-3DR-11@gated-at.bofh.it>
In reply to#1636142
On 05/04/2017 08:32 PM, Yisheng Xie wrote:
> Hi Laura,
> 
> On 2017/5/5 1:47, Laura Abbott wrote:
>> On 05/04/2017 07:45 AM, Yisheng Xie wrote:
>>> From: Yisheng Xie <xieyisheng1@huawei.com>
>>>
>>> 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 <xieyisheng1@huawei.com>
>>> ---
>>>  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
> 

Thanks for letting me know. Feel free to submit a patch to remove it.

Thanks,
Laura

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web