[MTD NAND] Use vmalloc for buffer when scanning for bad blocks.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri May 12 23:59:01 EDT 2006


commit c3f8abf481c2d2b221b028f7369bc6dd39a9590e
tree 58a8fbb73f736da8b4d0529e0e182ec41f30b6d5
parent 4992a9e88886b0c5ebc3d27eb74d0344c873eeea
author David Woodhouse <dwmw2 at infradead.org> Sat, 13 May 2006 04:03:42 +0100
committer David Woodhouse <dwmw2 at infradead.org> Sat, 13 May 2006 04:03:42 +0100

[MTD NAND] Use vmalloc for buffer when scanning for bad blocks.

These new chips have 128KiB blocks. Don't try to kmalloc that.

Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

 drivers/mtd/nand/nand_bbt.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index ca28699..32f063b 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -60,7 +60,7 @@ #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/compatmac.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
-
+#include <linux/vmalloc.h>
 
 /**
  * check_pattern - [GENERIC] check if a pattern is in the buffer
@@ -873,7 +873,7 @@ int nand_scan_bbt (struct mtd_info *mtd,
 	/* Allocate a temporary buffer for one eraseblock incl. oob */
 	len = (1 << this->bbt_erase_shift);
 	len += (len >> this->page_shift) * mtd->oobsize;
-	buf = kmalloc (len, GFP_KERNEL);
+	buf = vmalloc(len);
 	if (!buf) {
 		printk (KERN_ERR "nand_bbt: Out of memory\n");
 		kfree (this->bbt);
@@ -897,7 +897,7 @@ int nand_scan_bbt (struct mtd_info *mtd,
 	if (md)
 		mark_bbt_region (mtd, md);
 
-	kfree (buf);
+	vfree (buf);
 	return res;
 }
 




More information about the linux-mtd-cvs mailing list