Merge git://git.infradead.org/~dwmw2/mtd-2.6.31
* git://git.infradead.org/~dwmw2/mtd-2.6.31: JFFS2: add missing verify buffer allocation/deallocation mtd: nftl: fix offset alignments mtd: nftl: write support is broken mtd: m25p80: fix null pointer dereference bug
This commit is contained in:
@@ -1268,10 +1268,20 @@ int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c) {
|
||||
if (!c->wbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
|
||||
c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
|
||||
if (!c->wbuf_verify) {
|
||||
kfree(c->wbuf);
|
||||
return -ENOMEM;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c) {
|
||||
#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
|
||||
kfree(c->wbuf_verify);
|
||||
#endif
|
||||
kfree(c->wbuf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user