diff options
author | Patrick Georgi <patrick.georgi@coresystems.de> | 2009-09-30 11:21:18 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2009-09-30 11:21:18 +0000 |
commit | 56f5fb734bb92efd147912794071ff57c35cab04 (patch) | |
tree | 8f5c053087594166fb260c92e3bbd7d177518f50 /util/cbfstool/cbfstool.c | |
parent | 53ad9f585ddc3f40671adcd92a6341eadd229a06 (diff) |
Fix endless loop when trying to add a too large file to CBFS,
and report the correct error code, and a hopefully helpful
error message.
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4692 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r-- | util/cbfstool/cbfstool.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 7fa7a8510a..bf8b3812b8 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -80,7 +80,8 @@ static int cbfs_add(int argc, char **argv) } cbfsfile = create_cbfs_file(cbfsname, filedata, &filesize, type, &base); - add_file_to_cbfs(cbfsfile, filesize, base); + if (add_file_to_cbfs(cbfsfile, filesize, base)) + return 1; writerom(romname, rom, romsize); return 0; } @@ -127,7 +128,8 @@ static int cbfs_add_payload(int argc, char **argv) cbfsfile = create_cbfs_file(cbfsname, payload, &filesize, CBFS_COMPONENT_PAYLOAD, &base); - add_file_to_cbfs(cbfsfile, filesize, base); + if (add_file_to_cbfs(cbfsfile, filesize, base)) + return 1; writerom(romname, rom, romsize); return 0; } @@ -175,7 +177,8 @@ static int cbfs_add_stage(int argc, char **argv) create_cbfs_file(cbfsname, stage, &filesize, CBFS_COMPONENT_STAGE, &base); - add_file_to_cbfs(cbfsfile, filesize, base); + if (add_file_to_cbfs(cbfsfile, filesize, base)) + return 1; writerom(romname, rom, romsize); return 0; } |