From: Wolfgang Denk Date: Mon, 14 Feb 2011 20:11:36 +0100 Subject: [U-Boot] [PATCH 1/2] hush: Only run list if it's not empty Message-ID: <1297710697-13872-1-git-send-email-wd@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Running empty lists causes wrong return status Adapted from Barebox commit 4596d2b Author: Sascha Hauer Date: Thu Sep 17 11:11:51 2009 +0200 Signed-off-by: Wolfgang Denk --- common/hush.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/common/hush.c b/common/hush.c index 8021a68..c6f8392 100644 --- a/common/hush.c +++ b/common/hush.c @@ -3178,7 +3178,12 @@ int parse_stream_outer(struct in_str *inp, int flag) #ifndef __U_BOOT__ run_list(ctx.list_head); #else - code = run_list(ctx.list_head); + if (ctx.list_head->num_progs) { + code = run_list(ctx.list_head); + } else { + free_pipe_list(ctx.list_head, 0); + continue; + } if (code == -2) { /* exit */ b_free(&temp); code = 0; -- 1.7.4