summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/complete.c2
-rw-r--r--common/hush.c6
-rw-r--r--common/memory.c2
-rw-r--r--common/uimage.c6
4 files changed, 11 insertions, 5 deletions
diff --git a/common/complete.c b/common/complete.c
index 0b03d7ce9a..0780888cae 100644
--- a/common/complete.c
+++ b/common/complete.c
@@ -272,7 +272,7 @@ static char* cmd_complete_lookup(struct string_list *sl, char *instr)
{
struct command *cmdtp;
int len;
- int ret = 1;
+ int ret = COMPLETE_END;
char *res = NULL;
for_each_command(cmdtp) {
diff --git a/common/hush.c b/common/hush.c
index d915f9ed5b..3d51e4cc19 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1590,6 +1590,7 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla
if (rcode != 1 && ctx->old_flag != 0) {
syntax();
+ return 1;
}
if (rcode != 1 && ctx->old_flag == 0) {
done_word(&temp, ctx);
@@ -1614,8 +1615,9 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla
inp->__promptme = 1;
temp.nonnull = 0;
temp.quote = 0;
- inp->p = NULL;
- free_pipe_list(ctx->list_head, 0);
+ free_pipe_list(ctx->list_head,0);
+ b_free(&temp);
+ return 1;
}
b_free(&temp);
} while (rcode != -1 && !(flag & FLAG_EXIT_FROM_LOOP)); /* loop on syntax errors, return on EOF */
diff --git a/common/memory.c b/common/memory.c
index faff33b419..3b4a5ef4b3 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -58,7 +58,7 @@ void mem_malloc_init(void *start, void *end)
malloc_end = (unsigned long)end;
malloc_brk = malloc_start;
#ifdef CONFIG_MALLOC_TLSF
- tlsf_mem_pool = tlsf_create(start, (char *)end - (char *)start);
+ tlsf_mem_pool = tlsf_create(start, end - start + 1);
#endif
}
diff --git a/common/uimage.c b/common/uimage.c
index 4933c40583..945f3d6b0f 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -404,8 +404,12 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr)
res = NULL;
goto out;
}
- if (now < BUFSIZ)
+
+ if (now < BUFSIZ) {
+ release_sdram_region(res);
+ res = request_sdram_region("image", adr, ofs + now);
goto out;
+ }
release_sdram_region(res);