Hi,
Please find the latest report on new defect(s) introduced to coreboot found with Coverity Scan.
5 new defect(s) introduced to coreboot found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan Showing 5 of 5 defect(s)
** CID 1453149: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________ *** CID 1453149: Uninitialized variables (UNINIT) /tests/lib/spd_cache-test.c: 178 in test_check_if_dimm_changed_sn_error() 172 assert_int_equal(CB_SUCCESS, load_spd_cache(&spd_cache, &spd_cache_sz)); 173 fill_spd_cache_ddr4(spd_cache, spd_cache_sz); 174 assert_int_equal(CB_SUCCESS, spd_fill_from_cache(spd_cache, &blk)); 175 176 /* Simulate error */ 177 will_return_count(get_spd_sn, CB_ERR, 1);
CID 1453149: Uninitialized variables (UNINIT) Using uninitialized element of array "blk.addr_map" when calling "check_if_dimm_changed".
178 assert_true(check_if_dimm_changed(spd_cache, &blk)); 179 } 180 181 __attribute__((unused)) 182 static void test_check_if_dimm_changed_sodimm_lost(void **state) 183 {
** CID 1453148: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________ *** CID 1453148: Uninitialized variables (UNINIT) /tests/lib/spd_cache-test.c: 162 in test_check_if_dimm_changed_not_changed() 156 fill_spd_cache_ddr4(spd_cache, spd_cache_sz); 157 assert_int_equal(CB_SUCCESS, spd_fill_from_cache(spd_cache, &blk)); 158 159 get_sn_from_spd_cache(spd_cache, get_spd_sn_ret_sn); 160 get_spd_sn_ret_sn_idx = 0; 161 will_return_count(get_spd_sn, CB_SUCCESS, SC_SPD_NUMS);
CID 1453148: Uninitialized variables (UNINIT) Using uninitialized element of array "blk.addr_map" when calling "check_if_dimm_changed".
162 assert_false(check_if_dimm_changed(spd_cache, &blk)); 163 } 164 165 __attribute__((unused)) 166 static void test_check_if_dimm_changed_sn_error(void **state) 167 {
** CID 1453147: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________ *** CID 1453147: Uninitialized variables (UNINIT) /tests/lib/spd_cache-test.c: 233 in test_check_if_dimm_changed_sn_changed() 227 assert_int_equal(CB_SUCCESS, spd_fill_from_cache(spd_cache, &blk)); 228 get_sn_from_spd_cache(spd_cache, get_spd_sn_ret_sn); 229 *(u32 *)(spd_cache + SC_SPD_OFFSET(0) + DDR4_SPD_SN_OFF) = 0x43211234; 230 231 get_spd_sn_ret_sn_idx = 0; 232 will_return_always(get_spd_sn, CB_SUCCESS);
CID 1453147: Uninitialized variables (UNINIT) Using uninitialized element of array "blk.addr_map" when calling "check_if_dimm_changed".
233 assert_true(check_if_dimm_changed(spd_cache, &blk)); 234 } 235 236 int main(void) 237 { 238 const struct CMUnitTest tests[] = {
** CID 1453146: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________ *** CID 1453146: Uninitialized variables (UNINIT) /tests/lib/spd_cache-test.c: 196 in test_check_if_dimm_changed_sodimm_lost() 190 assert_int_equal(CB_SUCCESS, spd_fill_from_cache(spd_cache, &blk)); 191 get_sn_from_spd_cache(spd_cache, get_spd_sn_ret_sn); 192 memset(spd_cache + spd_data_ddr4_1_sz, 0xff, spd_data_ddr4_2_sz); 193 194 get_spd_sn_ret_sn_idx = 0; 195 will_return_always(get_spd_sn, CB_SUCCESS);
CID 1453146: Uninitialized variables (UNINIT) Using uninitialized element of array "blk.addr_map" when calling "check_if_dimm_changed".
196 assert_true(check_if_dimm_changed(spd_cache, &blk)); 197 } 198 199 __attribute__((unused)) 200 static void test_check_if_dimm_changed_new_sodimm(void **state) 201 {
** CID 1453145: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________ *** CID 1453145: Uninitialized variables (UNINIT) /tests/lib/spd_cache-test.c: 215 in test_check_if_dimm_changed_new_sodimm() 209 get_sn_from_spd_cache(spd_cache, get_spd_sn_ret_sn); 210 memcpy(spd_cache + spd_data_ddr4_1_sz + spd_data_ddr4_2_sz, 211 spd_data_ddr4_2, spd_data_ddr4_2_sz); 212 213 get_spd_sn_ret_sn_idx = 0; 214 will_return_always(get_spd_sn, CB_SUCCESS);
CID 1453145: Uninitialized variables (UNINIT) Using uninitialized element of array "blk.addr_map" when calling "check_if_dimm_changed".
215 assert_true(check_if_dimm_changed(spd_cache, &blk)); 216 } 217 218 __attribute__((unused)) 219 static void test_check_if_dimm_changed_sn_changed(void **state) 220 {
________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0...