From 6b2d2db9eb514f6c54cf951fe864e052b680edef Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 14 Dec 2016 16:11:58 +0100 Subject: [PATCH] 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 Found-by: Coverity Scan #1294797 Reviewed-on: https://review.coreboot.org/17860 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- util/cbfstool/cbfstool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 7a714275f7..d3c15e01fc 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -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; }