else
len = mtd->oobsize;
+ if (len == 0)
+ return 0;
+
if (unlikely(ops->ooboffs >= len)) {
pr_debug("%s: attempt to start read outside oob\n",
__func__);
else
len = mtd->oobsize;
+ if (len == 0)
+ return 0;
+
/* Do not allow write past end of page */
if ((ops->ooboffs + ops->ooblen) > len) {
pr_debug("%s: attempt to write past end of page\n",
if (!flashbuf) {
/* For NAND it's quicker to read a whole eraseblock at a time,
apparently */
- if (jffs2_cleanmarker_oob(c))
+ if (c->mtd->type == MTD_NANDFLASH)
try_size = c->sector_size;
else
try_size = PAGE_SIZE;
jffs2_dbg(1, "%s(): Scanning block at 0x%x\n", __func__, ofs);
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
- if (jffs2_cleanmarker_oob(c)) {
+ if (c->mtd->type == MTD_NANDFLASH) {
int ret;
if (mtd_block_isbad(c->mtd, jeb->offset))
/* Cleanmarker is out-of-band, so inline size zero */
c->cleanmarker_size = 0;
- if (!oinfo || oinfo->oobavail == 0) {
+ if (!oinfo /* || oinfo->oobavail == 0 */) {
pr_err("inconsistent device description\n");
return -EINVAL;
}