summaryrefslogtreecommitdiff
path: root/cmd/legacy-mtd-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/legacy-mtd-utils.c')
-rw-r--r--cmd/legacy-mtd-utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/legacy-mtd-utils.c b/cmd/legacy-mtd-utils.c
index ac7139f84d..5903a90fe5 100644
--- a/cmd/legacy-mtd-utils.c
+++ b/cmd/legacy-mtd-utils.c
@@ -88,6 +88,11 @@ int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off,
return -1;
}
+ if (*size == 0) {
+ debug("ERROR: Invalid size 0\n");
+ return -1;
+ }
+
print:
printf("device %d ", *idx);
if (*size == chipsize)