diff options
author | Thejaswani Putta <thejaswani.putta@intel.com> | 2019-04-11 18:36:08 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-04-23 09:56:37 +0000 |
commit | 6f5225c7e0ad7a373af1decc212cde5c33b00730 (patch) | |
tree | 794593f84299c9258953eb34fdd39ecee39a1f20 /util/cbfstool | |
parent | 21f9b3ecd7babefa51f497bd61495316ebf41851 (diff) |
Klocwork: Fix the Null pointer derefernce found by klocwork
Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com>
Change-Id: I15973ac28e9645826986cf63d2160eedb83024e4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32290
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Lijian Zhao <lijian.zhao@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/cbfstool')
-rw-r--r-- | util/cbfstool/cbfs_sections.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs_sections.c b/util/cbfstool/cbfs_sections.c index 285725760b..088534adc9 100644 --- a/util/cbfstool/cbfs_sections.c +++ b/util/cbfstool/cbfs_sections.c @@ -14,6 +14,7 @@ */ #include "cbfs_sections.h" +#include "common.h" #include <assert.h> #include <stdlib.h> @@ -65,6 +66,10 @@ bool fmd_process_flag_cbfs(const struct flashmap_descriptor *node) return false; list_node = (struct descriptor_node *)malloc(sizeof(*list_node)); + if (!list_node) { + ERROR("Cannot allocate CBFS flag node!\n"); + return false; + } list_node->val = node; list_node->next = NULL; |