提交 c3f8abf4 编写于 作者: D David Woodhouse

[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: NDavid Woodhouse <dwmw2@infradead.org>
上级 4992a9e8
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#include <linux/mtd/compatmac.h> #include <linux/mtd/compatmac.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/vmalloc.h>
/** /**
* check_pattern - [GENERIC] check if a pattern is in the buffer * check_pattern - [GENERIC] check if a pattern is in the buffer
...@@ -873,7 +873,7 @@ int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd) ...@@ -873,7 +873,7 @@ int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
/* Allocate a temporary buffer for one eraseblock incl. oob */ /* Allocate a temporary buffer for one eraseblock incl. oob */
len = (1 << this->bbt_erase_shift); len = (1 << this->bbt_erase_shift);
len += (len >> this->page_shift) * mtd->oobsize; len += (len >> this->page_shift) * mtd->oobsize;
buf = kmalloc (len, GFP_KERNEL); buf = vmalloc(len);
if (!buf) { if (!buf) {
printk (KERN_ERR "nand_bbt: Out of memory\n"); printk (KERN_ERR "nand_bbt: Out of memory\n");
kfree (this->bbt); kfree (this->bbt);
...@@ -897,7 +897,7 @@ int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd) ...@@ -897,7 +897,7 @@ int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
if (md) if (md)
mark_bbt_region (mtd, md); mark_bbt_region (mtd, md);
kfree (buf); vfree (buf);
return res; return res;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册