All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ion: hisilicon: check the right value after ion_heap_create
@ 2017-05-04 14:45 Yisheng Xie
  2017-05-04 17:47 ` Laura Abbott
  0 siblings, 1 reply; 4+ messages in thread
From: Yisheng Xie @ 2017-05-04 14:45 UTC (permalink / raw)
  To: labbott, sumit.semwal, gregkh, arve, riandrews, wporter82
  Cc: devel, linux-kernel

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

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

* Re: [PATCH] ion: hisilicon: check the right value after ion_heap_create
  2017-05-04 14:45 [PATCH] ion: hisilicon: check the right value after ion_heap_create Yisheng Xie
@ 2017-05-04 17:47 ` Laura Abbott
  2017-05-05  3:32   ` Yisheng Xie
  0 siblings, 1 reply; 4+ messages in thread
From: Laura Abbott @ 2017-05-04 17:47 UTC (permalink / raw)
  To: Yisheng Xie, sumit.semwal, gregkh, arve, riandrews, wporter82
  Cc: devel, linux-kernel

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

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

* Re: [PATCH] ion: hisilicon: check the right value after ion_heap_create
  2017-05-04 17:47 ` Laura Abbott
@ 2017-05-05  3:32   ` Yisheng Xie
  2017-05-05 15:44     ` Laura Abbott
  0 siblings, 1 reply; 4+ messages in thread
From: Yisheng Xie @ 2017-05-05  3:32 UTC (permalink / raw)
  To: Laura Abbott, Yisheng Xie, sumit.semwal, gregkh, arve, riandrews,
	wporter82
  Cc: devel, linux-kernel

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

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

* Re: [PATCH] ion: hisilicon: check the right value after ion_heap_create
  2017-05-05  3:32   ` Yisheng Xie
@ 2017-05-05 15:44     ` Laura Abbott
  0 siblings, 0 replies; 4+ messages in thread
From: Laura Abbott @ 2017-05-05 15:44 UTC (permalink / raw)
  To: Yisheng Xie, Yisheng Xie, sumit.semwal, gregkh, arve, riandrews,
	wporter82
  Cc: devel, linux-kernel

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

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

end of thread, other threads:[~2017-05-05 15:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04 14:45 [PATCH] ion: hisilicon: check the right value after ion_heap_create Yisheng Xie
2017-05-04 17:47 ` Laura Abbott
2017-05-05  3:32   ` Yisheng Xie
2017-05-05 15:44     ` Laura Abbott

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.