summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_flash.c5
-rw-r--r--common/hush.c18
2 files changed, 15 insertions, 8 deletions
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 99d9130..430a33e 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -164,6 +164,11 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
sect = s_last[bank];
addr_first = (sect == s_end) ? b_end + 1: info->start[sect + 1];
(*s_count) += s_last[bank] - s_first[bank] + 1;
+ } else if (s_last[bank] >= 0) {
+ printf("Error: cannot span across banks when they are"
+ " mapped in reverse order\n");
+ rcode = 1;
+ break;
}
}
diff --git a/common/hush.c b/common/hush.c
index dbb952d..7e8a80d 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -313,7 +313,7 @@ struct variables *top_vars = &shell_ver;
#else
static int flag_repeat = 0;
static int do_repeat = 0;
-static struct variables *top_vars ;
+static struct variables *top_vars = NULL ;
#endif /*__U_BOOT__ */
#define B_CHUNK (100)
@@ -3194,13 +3194,15 @@ static void u_boot_hush_reloc(void)
int u_boot_hush_start(void)
{
- top_vars = malloc(sizeof(struct variables));
- top_vars->name = "HUSH_VERSION";
- top_vars->value = "0.01";
- top_vars->next = 0;
- top_vars->flg_export = 0;
- top_vars->flg_read_only = 1;
- u_boot_hush_reloc();
+ if (top_vars == NULL) {
+ top_vars = malloc(sizeof(struct variables));
+ top_vars->name = "HUSH_VERSION";
+ top_vars->value = "0.01";
+ top_vars->next = 0;
+ top_vars->flg_export = 0;
+ top_vars->flg_read_only = 1;
+ u_boot_hush_reloc();
+ }
return 0;
}