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>
This commit is contained in:
		
				
					committed by
					
						
						Patrick Georgi
					
				
			
			
				
	
			
			
			
						parent
						
							943e479b3e
						
					
				
				
					commit
					d5433afb28
				
			@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user