public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vmalloc.c: fix double error checking
@ 2009-07-07 16:13 Figo.zhang
  2009-07-08  0:19 ` Tejun Heo
  2009-07-08  2:11 ` [PATCH v2] " Figo.zhang
  0 siblings, 2 replies; 6+ messages in thread
From: Figo.zhang @ 2009-07-07 16:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Tejun Heo, lkml

it is no need for double error checking.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
--- 
mm/vmalloc.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index f8189a4..56b2469 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -159,20 +159,15 @@ static int vmap_page_range_noflush(unsigned long start, unsigned long end,
 	pgd_t *pgd;
 	unsigned long next;
 	unsigned long addr = start;
-	int err = 0;
 	int nr = 0;
 
 	BUG_ON(addr >= end);
 	pgd = pgd_offset_k(addr);
 	do {
 		next = pgd_addr_end(addr, end);
-		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;
 	} while (pgd++, addr = next, addr != end);
-
-	if (unlikely(err))
-		return err;
 	return nr;
 }
 



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

end of thread, other threads:[~2009-07-08  2:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07 16:13 [PATCH] vmalloc.c: fix double error checking Figo.zhang
2009-07-08  0:19 ` Tejun Heo
2009-07-08  0:40   ` Figo.zhang
2009-07-08  2:02     ` Tejun Heo
2009-07-08  2:11 ` [PATCH v2] " Figo.zhang
2009-07-08  2:16   ` Tejun Heo

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