diff options
author | Timothy Pearson <tpearson@raptorengineering.com> | 2017-01-09 14:54:24 -0600 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2017-01-11 00:19:21 +0100 |
commit | a20d0e0f79cdff543a584ed6187ba6e86e76ddac (patch) | |
tree | 647cff426b645699860b3ea648753d73681fb284 /src/northbridge/amd | |
parent | 6f9468f019239af70c20de9fca411fc76a00db1b (diff) |
amd/mct/ddr3: Free malloced resources in failure branches
Malloced resources were not freed in failure branches during
S3 parameter save. Clean up Coverity warnings by freeing
resources in failure branches.
Found-by: Coverity Scan #1347344
Change-Id: I5f119874e52ef2090ca1579db170a49a2a6a0a2a
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Reviewed-on: https://review.coreboot.org/18074
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r-- | src/northbridge/amd/amdmct/mct_ddr3/s3utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c b/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c index 4013c2e538..f69b6c4496 100644 --- a/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c +++ b/src/northbridge/amd/amdmct/mct_ddr3/s3utils.c @@ -1123,13 +1123,16 @@ int8_t save_mct_information_to_nvram(void) set_option("allow_spd_nvram_cache_restore", &nvram); printk(BIOS_DEBUG, "Hardware configuration unchanged since last boot; skipping write\n"); + free(persistent_data); return 0; } /* Obtain CBFS file offset */ s3nv_offset = get_s3nv_file_offset(); - if (s3nv_offset == -1) + if (s3nv_offset == -1) { + free(persistent_data); return -1; + } /* Align flash pointer to nearest boundary */ s3nv_offset &= ~(CONFIG_S3_DATA_SIZE-1); |