Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195962
b: refs/heads/master
c: 4a8ce0b
h: refs/heads/master
v: v3
  • Loading branch information
Kyungmin Park authored and David Woodhouse committed May 14, 2010
1 parent 4c3c78f commit e0c0782
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a88c47bd528cb0f82692986a3ca57b3695d9c60
refs/heads/master: 4a8ce0b030716b95004a4ace969953bc3ad7d2fe
13 changes: 12 additions & 1 deletion trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3932,6 +3932,13 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
__func__);
return -ENOMEM;
}
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
this->verify_buf = kzalloc(mtd->writesize, GFP_KERNEL);
if (!this->verify_buf) {
kfree(this->page_buf);
return -ENOMEM;
}
#endif
this->options |= ONENAND_PAGEBUF_ALLOC;
}
if (!this->oob_buf) {
Expand Down Expand Up @@ -4059,8 +4066,12 @@ void onenand_release(struct mtd_info *mtd)
kfree(this->bbm);
}
/* Buffers allocated by onenand_scan */
if (this->options & ONENAND_PAGEBUF_ALLOC)
if (this->options & ONENAND_PAGEBUF_ALLOC) {
kfree(this->page_buf);
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
kfree(this->verify_buf);
#endif
}
if (this->options & ONENAND_OOBBUF_ALLOC)
kfree(this->oob_buf);
kfree(mtd->eraseregions);
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/mtd/onenand.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ struct onenand_chip {
flstate_t state;
unsigned char *page_buf;
unsigned char *oob_buf;
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
unsigned char *verify_buf;
#endif

int subpagesize;
struct nand_ecclayout *ecclayout;
Expand Down

0 comments on commit e0c0782

Please sign in to comment.