瀏覽代碼

nand_util: correct YAFFS image write function

In function nand_write_skip_bad(),for YAFFS filesystem part,
write_oob() will return 0 when success, so when rval equals 0,
it should continue to write the next page, and no break.

Signed-off-by: Wentao, Liu <wentao.liu@intel.com>
Acked-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
Liu, Wentao 13 年之前
父節點
當前提交
65683026a5
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mtd/nand/nand_util.c

+ 1 - 1
drivers/mtd/nand/nand_util.c

@@ -564,7 +564,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
 				ops.oobbuf = ops.datbuf + pagesize;
 				ops.oobbuf = ops.datbuf + pagesize;
 
 
 				rval = nand->write_oob(nand, offset, &ops);
 				rval = nand->write_oob(nand, offset, &ops);
-				if (!rval)
+				if (rval != 0)
 					break;
 					break;
 
 
 				offset += pagesize;
 				offset += pagesize;