summaryrefslogtreecommitdiff
path: root/cmd/ubi.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/ubi.c')
-rw-r--r--cmd/ubi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/ubi.c b/cmd/ubi.c
index 171377cc66..cb14e3e1e7 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -264,6 +264,11 @@ static int ubi_rename_vol(char *oldname, char *newname)
return ENODEV;
}
+ if (!ubi_check(newname)) {
+ printf("%s: volume %s already exist\n", __func__, newname);
+ return EINVAL;
+ }
+
printf("Rename UBI volume %s to %s\n", oldname, newname);
if (ubi->ro_mode) {