lkml.org 
[lkml]   [2009]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] vmalloc.c: fix double error checking
From
Date
On Wed, 2009-07-08 at 09:19 +0900, Tejun Heo wrote:
> Figo.zhang wrote:
> > it is no need for double error checking.
> >
> > Signed-off-by: Figo.zhang <figo1802@gmail.com>
> > - err = vmap_pud_range(pgd, addr, next, prot, pages, &nr);
> > - if (err)
> > - break;
> > + if (vmap_pud_range(pgd, addr, next, prot, pages, &nr))
> > + return -ENOMEM;
>
> Wouldn't it be better to keep the error return value?

see the vmap_pud_range(), if suceed return 0, if error return "-ENOMEM",
so it had better use clearly logic if error directly return "-EOMEM",
avoid double checking.

Best,
Figo.zhang


>
> Thanks.
>
> --
> tejun



\
 
 \ /
  Last update: 2009-07-08 02:43    [from the cache]
©2003-2011 Jasper Spaans