summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flash/nor/tcl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index a3efd805..a6e942e0 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -795,6 +795,14 @@ COMMAND_HANDLER(handle_flash_bank_command)
return ERROR_FAIL;
}
+ /* check the flash bank name is unique */
+ if (get_flash_bank_by_name(bank_name) != NULL)
+ {
+ /* flash bank name already exists */
+ LOG_ERROR("flash bank name '%s' already exists", bank_name);
+ return ERROR_FAIL;
+ }
+
/* register flash specific commands */
if (NULL != driver->commands)
{