public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] arch: metag: kernel: dma.c: check 'pud' whether is NULL in dma_alloc_init()
       [not found] <528485A9.5050509@asianux.com>
@ 2013-11-14  9:25 ` Xishi Qiu
  2013-11-14  9:41   ` Chen Gang
  0 siblings, 1 reply; 2+ messages in thread
From: Xishi Qiu @ 2013-11-14  9:25 UTC (permalink / raw)
  To: Chen Gang; +Cc: James Hogan, Andrew Morton, linux-metag, LKML

On 2013/11/14 16:11, Chen Gang wrote:

> Like another p?d_alloc(), pud_alloc() also may fail, so need check it.
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/metag/kernel/dma.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c
> index db589ad..e6cf39b 100644
> --- a/arch/metag/kernel/dma.c
> +++ b/arch/metag/kernel/dma.c
> @@ -398,6 +398,11 @@ static int __init dma_alloc_init(void)
>  		int offset = pgd_index(CONSISTENT_START);
>  		pgd = pgd_offset(&init_mm, CONSISTENT_START);
>  		pud = pud_alloc(&init_mm, pgd, CONSISTENT_START);
> +		if (!pud) {
> +			pr_err("%s: no pud tables\n", __func__);
> +			ret = -ENOMEM;
> +			break;
> +		}

It looks fine to me.

Thanks,
Xishi Qiu

>  		pmd = pmd_alloc(&init_mm, pud, CONSISTENT_START);
>  		if (!pmd) {
>  			pr_err("%s: no pmd tables\n", __func__);



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

* Re: [PATCH] arch: metag: kernel: dma.c: check 'pud' whether is NULL in dma_alloc_init()
  2013-11-14  9:25 ` [PATCH] arch: metag: kernel: dma.c: check 'pud' whether is NULL in dma_alloc_init() Xishi Qiu
@ 2013-11-14  9:41   ` Chen Gang
  0 siblings, 0 replies; 2+ messages in thread
From: Chen Gang @ 2013-11-14  9:41 UTC (permalink / raw)
  To: Xishi Qiu; +Cc: James Hogan, Andrew Morton, linux-metag, LKML

On 11/14/2013 05:25 PM, Xishi Qiu wrote:
> On 2013/11/14 16:11, Chen Gang wrote:
> 
>> Like another p?d_alloc(), pud_alloc() also may fail, so need check it.
>>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>>  arch/metag/kernel/dma.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c
>> index db589ad..e6cf39b 100644
>> --- a/arch/metag/kernel/dma.c
>> +++ b/arch/metag/kernel/dma.c
>> @@ -398,6 +398,11 @@ static int __init dma_alloc_init(void)
>>  		int offset = pgd_index(CONSISTENT_START);
>>  		pgd = pgd_offset(&init_mm, CONSISTENT_START);
>>  		pud = pud_alloc(&init_mm, pgd, CONSISTENT_START);
>> +		if (!pud) {
>> +			pr_err("%s: no pud tables\n", __func__);
>> +			ret = -ENOMEM;
>> +			break;
>> +		}
> 
> It looks fine to me.
> 

Thank you too.

James has his opinion about it, we are just discussing, welcome you
join.

:-)


Thanks.

> Thanks,
> Xishi Qiu
> 
>>  		pmd = pmd_alloc(&init_mm, pud, CONSISTENT_START);
>>  		if (!pmd) {
>>  			pr_err("%s: no pmd tables\n", __func__);
> 
> 
> 
> 
-- 
Chen Gang

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

end of thread, other threads:[~2013-11-14  9:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <528485A9.5050509@asianux.com>
2013-11-14  9:25 ` [PATCH] arch: metag: kernel: dma.c: check 'pud' whether is NULL in dma_alloc_init() Xishi Qiu
2013-11-14  9:41   ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox