summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libmtd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libmtd.c b/lib/libmtd.c
index a363e56..4aee947 100644
--- a/lib/libmtd.c
+++ b/lib/libmtd.c
@@ -792,7 +792,7 @@ int mtd_get_dev_info1(libmtd_t desc, int mtd_num, struct mtd_dev_info *mtd)
return -1;
mtd->writable = !!(ret & MTD_WRITEABLE);
- if (ret & MTD_NO_ERASE)
+ if ((ret & MTD_NO_ERASE) && (mtd->eb_size == 0))
mtd->eb_cnt = 1;
else
mtd->eb_cnt = mtd->size / mtd->eb_size;