summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@silverbackltd.com>2018-02-14 10:18:17 -0700
committerMartin Roth <martinroth@google.com>2018-02-15 21:39:16 +0000
commit405f72952ceb0d28726cd576228fda43909951b1 (patch)
treec5d16a697af5be987a408c63d3ecb818daa2751c /src
parent5e83e8b130a7072fd62b581f260545689dcf73fc (diff)
downloadcoreboot-405f72952ceb0d28726cd576228fda43909951b1.tar.xz
soc/amd/common/block/s3/s3_resume.c: Check mrc_cache_get_current() return
Procedure mrc_cache_get_current() returns -1 for error, 0 for pass. Do check the return in procedure get_s3nv_info. This fixes CID 1385943 BUG=b:73333332 TEST=Build kahlee Change-Id: I0f6a58380a38d13120e997dcd966423d3c2af091 Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/23761 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/common/block/s3/s3_resume.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/s3/s3_resume.c b/src/soc/amd/common/block/s3/s3_resume.c
index 4883fa5597..1ba9468e35 100644
--- a/src/soc/amd/common/block/s3/s3_resume.c
+++ b/src/soc/amd/common/block/s3/s3_resume.c
@@ -27,7 +27,11 @@ void get_s3nv_info(void **base, size_t *size)
{
struct region_device rdev;
- mrc_cache_get_current(MRC_TRAINING_DATA, DEFAULT_MRC_VERSION, &rdev);
+ if (mrc_cache_get_current(MRC_TRAINING_DATA, DEFAULT_MRC_VERSION,
+ &rdev)) {
+ printk(BIOS_ERR, "mrc_cache_get_current returned error\n");
+ return;
+ }
*base = rdev_mmap_full(&rdev);
*size = region_device_sz(&rdev);
if (!*base || !*size)