--- linux-2.6.28.7/orig/drivers/mtd/nand/nand_bbt.c +++ linux-2.6.28.7/mod/drivers/mtd/nand/nand_bbt.c @@ -1027,11 +1027,10 @@ if (!this->bbt || !td) return -EINVAL; - len = mtd->size >> (this->bbt_erase_shift + 2); /* 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_update_bbt: Out of memory\n"); return -ENOMEM; @@ -1064,7 +1063,7 @@ } out: - kfree(buf); + vfree(buf); return res; }