diff options
Diffstat (limited to 'drivers/mtd/ubi/eba.c')
-rw-r--r-- | drivers/mtd/ubi/eba.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index 85f50c83cf42..c87db07bcd0c 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c | |||
@@ -656,11 +656,14 @@ retry: | |||
656 | goto write_error; | 656 | goto write_error; |
657 | } | 657 | } |
658 | 658 | ||
659 | err = ubi_io_write_data(ubi, buf, pnum, offset, len); | 659 | if (len) { |
660 | if (err) { | 660 | err = ubi_io_write_data(ubi, buf, pnum, offset, len); |
661 | ubi_warn("failed to write %d bytes at offset %d of LEB %d:%d, " | 661 | if (err) { |
662 | "PEB %d", len, offset, vol_id, lnum, pnum); | 662 | ubi_warn("failed to write %d bytes at offset %d of " |
663 | goto write_error; | 663 | "LEB %d:%d, PEB %d", len, offset, vol_id, |
664 | lnum, pnum); | ||
665 | goto write_error; | ||
666 | } | ||
664 | } | 667 | } |
665 | 668 | ||
666 | vol->eba_tbl[lnum] = pnum; | 669 | vol->eba_tbl[lnum] = pnum; |