summaryrefslogtreecommitdiffstats
path: root/commands/bootm.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/bootm.c')
-rw-r--r--commands/bootm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/bootm.c b/commands/bootm.c
index 8e51695d94..20b49f0cd1 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -70,6 +70,7 @@ static int bootm_open_os_uimage(struct image_data *data)
if (ret) {
printf("Checking data crc failed with %s\n",
strerror(-ret));
+ uimage_close(data->os);
return ret;
}
}
@@ -79,6 +80,7 @@ static int bootm_open_os_uimage(struct image_data *data)
if (data->os->header.ih_arch != IH_ARCH) {
printf("Unsupported Architecture 0x%x\n",
data->os->header.ih_arch);
+ uimage_close(data->os);
return -EINVAL;
}
@@ -88,8 +90,10 @@ static int bootm_open_os_uimage(struct image_data *data)
if (data->os_address != UIMAGE_INVALID_ADDRESS) {
data->os_res = uimage_load_to_sdram(data->os, 0,
data->os_address);
- if (!data->os_res)
+ if (!data->os_res) {
+ uimage_close(data->os);
return -ENOMEM;
+ }
}
return 0;