From d5433afb28ad6e9c3435310032ed8c7415d1875f Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Mon, 17 May 2021 10:53:22 +0200 Subject: tests/lib/spd_cache-test: Initialize spd_block.addr_map Coverity reported unitialized array spd_block.addr_map which values are not used. Add initialization to silence Coverity and avoid errors in the future. Signed-off-by: Jakub Czapiga Found-by: Coverity CID 1453145 1453146 1453147 1453148 1453149 Change-Id: If301f9e5d9e06ad26769bd0717f1f906e620d82d Reviewed-on: https://review.coreboot.org/c/coreboot/+/54355 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Paul Fagerburg --- tests/lib/spd_cache-test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/lib/spd_cache-test.c b/tests/lib/spd_cache-test.c index 4502ce6d23ef..ef0f6ef5acb2 100644 --- a/tests/lib/spd_cache-test.c +++ b/tests/lib/spd_cache-test.c @@ -150,7 +150,7 @@ static void test_check_if_dimm_changed_not_changed(void **state) { uint8_t *spd_cache; size_t spd_cache_sz; - struct spd_block blk; + struct spd_block blk = { .addr_map = {0}, .spd_array = {0}, .len = 0 }; assert_int_equal(CB_SUCCESS, load_spd_cache(&spd_cache, &spd_cache_sz)); fill_spd_cache_ddr4(spd_cache, spd_cache_sz); @@ -167,7 +167,7 @@ static void test_check_if_dimm_changed_sn_error(void **state) { uint8_t *spd_cache; size_t spd_cache_sz; - struct spd_block blk; + struct spd_block blk = { .addr_map = {0}, .spd_array = {0}, .len = 0 }; assert_int_equal(CB_SUCCESS, load_spd_cache(&spd_cache, &spd_cache_sz)); fill_spd_cache_ddr4(spd_cache, spd_cache_sz); @@ -183,7 +183,7 @@ static void test_check_if_dimm_changed_sodimm_lost(void **state) { uint8_t *spd_cache; size_t spd_cache_sz; - struct spd_block blk; + struct spd_block blk = { .addr_map = {0}, .spd_array = {0}, .len = 0 }; assert_int_equal(CB_SUCCESS, load_spd_cache(&spd_cache, &spd_cache_sz)); fill_spd_cache_ddr4(spd_cache, spd_cache_sz); @@ -201,7 +201,7 @@ static void test_check_if_dimm_changed_new_sodimm(void **state) { uint8_t *spd_cache; size_t spd_cache_sz; - struct spd_block blk; + struct spd_block blk = { .addr_map = {0}, .spd_array = {0}, .len = 0 }; assert_int_equal(CB_SUCCESS, load_spd_cache(&spd_cache, &spd_cache_sz)); fill_spd_cache_ddr4(spd_cache, spd_cache_sz); @@ -220,7 +220,7 @@ static void test_check_if_dimm_changed_sn_changed(void **state) { uint8_t *spd_cache; size_t spd_cache_sz; - struct spd_block blk; + struct spd_block blk = { .addr_map = {0}, .spd_array = {0}, .len = 0 }; assert_int_equal(CB_SUCCESS, load_spd_cache(&spd_cache, &spd_cache_sz)); fill_spd_cache_ddr4(spd_cache, spd_cache_sz); -- cgit v1.2.3