diff options
author | Jakub Czapiga <jacz@semihalf.com> | 2021-05-17 10:53:22 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-05-18 10:08:39 +0000 |
commit | d5433afb28ad6e9c3435310032ed8c7415d1875f (patch) | |
tree | fb87adc6d91c32354a4faf621c17d0a1222826e5 /tests/lib | |
parent | 943e479b3e1f0c6e2555d41f3b01177cc78f273f (diff) |
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 <jacz@semihalf.com>
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) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/spd_cache-test.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/lib/spd_cache-test.c b/tests/lib/spd_cache-test.c index 4502ce6d23..ef0f6ef5ac 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); |