summaryrefslogtreecommitdiff
path: root/common/cmd_bootm.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-07-11 09:35:23 -0400
committerTom Rini <trini@ti.com>2013-07-12 10:32:39 -0400
commit970150a167c7b12973c53e64ea1973d8bd581f2e (patch)
treea010f7a2024f04d11062ca90bdc0d8b1477ba025 /common/cmd_bootm.c
parentecc8edbf6995558d8a47b43ac6645840c98a7b95 (diff)
downloadu-boot-imx-970150a167c7b12973c53e64ea1973d8bd581f2e.zip
u-boot-imx-970150a167c7b12973c53e64ea1973d8bd581f2e.tar.gz
u-boot-imx-970150a167c7b12973c53e64ea1973d8bd581f2e.tar.bz2
cmd_bootm.c: Re-order bootm_load_os return check for ELDK4.2
With ELDK4.2 we were getting a warning that load_end may be used uninitialized in calling lmb_reserve. This could not be the case, however. If we re-order the checks (and make them slightly clearer as well) the warning goes away. bootm_load_os may only return 0 on success, BOOTM_ERR_OVERLAP in a non-fatal overlap (already covered in comments) or a fatal BOOTM_ERR that is covered in the error handler. Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r--common/cmd_bootm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index a783cea..306c8f3 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -650,12 +650,11 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
iflag = bootm_disable_interrupts();
ret = bootm_load_os(images, &load_end, 0);
- if (ret && ret != BOOTM_ERR_OVERLAP)
- goto err;
-
if (ret == 0)
lmb_reserve(&images->lmb, images->os.load,
(load_end - images->os.load));
+ else if (ret && ret != BOOTM_ERR_OVERLAP)
+ goto err;
else if (ret == BOOTM_ERR_OVERLAP)
ret = 0;
}