diff options
author | Vicente <vicencb@gmail.com> | 2012-10-09 00:55:17 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-10 09:29:58 +0200 |
commit | 8083e2e024714c42d47d8ebd82e97b17527ac759 (patch) | |
tree | 45716f919961d2028d5347b190e41832c5f8780c /commands/bootm.c | |
parent | 7764b1facaaa50b3e3114991ec78858efe5e8b8d (diff) | |
download | barebox-8083e2e024714c42d47d8ebd82e97b17527ac759.tar.gz barebox-8083e2e024714c42d47d8ebd82e97b17527ac759.tar.xz |
bootm: close open files
Signed-off-by: Vicente <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/bootm.c')
-rw-r--r-- | commands/bootm.c | 6 |
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; |