util/cbfstool: check that buffer_create worked

We might not care much about this buffer, but we really use it later
on...

Change-Id: Ia16270f836d05d8b454e77de7b5babeb6bb05d6d
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1294797
Reviewed-on: https://review.coreboot.org/17860
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
This commit is contained in:
Patrick Georgi 2016-12-14 16:11:58 +01:00 committed by Patrick Georgi
parent 862df924e3
commit 6b2d2db9eb
1 changed files with 2 additions and 1 deletions

View File

@ -776,7 +776,8 @@ static int cbfs_create(void)
struct buffer bootblock;
if (!param.bootblock) {
DEBUG("-B not given, creating image without bootblock.\n");
buffer_create(&bootblock, 0, "(dummy)");
if (buffer_create(&bootblock, 0, "(dummy)") != 0)
return 1;
} else if (buffer_from_file(&bootblock, param.bootblock)) {
return 1;
}