summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-05-16 20:23:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-16 20:23:44 +0200
commite741110f5a4089f22dbaae97443753acd4851bdd (patch)
tree86acf2e6c390d633da5be4a4ea4e1c6d024c4bec /common
parent9115339720c3df3c9b40dae7adbef137362efcc0 (diff)
parent0d188aca536284f3c9650d8857c43c0dd5a81c2c (diff)
downloadbarebox-e741110f5a4089f22dbaae97443753acd4851bdd.tar.gz
barebox-e741110f5a4089f22dbaae97443753acd4851bdd.tar.xz
Merge branch 'master' into next
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 0b03d7ce9..0780888ca 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 d915f9ed5..3d51e4cc1 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 faff33b41..3b4a5ef4b 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 4933c4058..945f3d6b0 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);