Hi,
Please find the latest report on new defect(s) introduced to coreboot found with Coverity Scan.
4 new defect(s) introduced to coreboot found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan Showing 4 of 4 defect(s)
** CID 1501609: Control flow issues (NO_EFFECT) /src/northbridge/intel/haswell/native_raminit/raminit_main.c: 65 in try_raminit()
________________________________________________________________________________________________________ *** CID 1501609: Control flow issues (NO_EFFECT) /src/northbridge/intel/haswell/native_raminit/raminit_main.c: 65 in try_raminit() 59 { 60 const struct task_entry *const schedule = cold_boot; 61 const size_t length = ARRAY_SIZE(cold_boot); 62 63 enum raminit_status status = RAMINIT_STATUS_UNSPECIFIED_ERROR; 64
CID 1501609: Control flow issues (NO_EFFECT) This less-than-zero comparison of an unsigned value is never true. "i < 0UL".
65 for (size_t i = 0; i < length; i++) { 66 const struct task_entry *const entry = &schedule[i]; 67 assert(entry); 68 assert(entry->name); 69 if (!entry->is_enabled) 70 continue;
** CID 1501608: Control flow issues (DEADCODE) /src/northbridge/intel/haswell/native_raminit/raminit_main.c: 66 in try_raminit()
________________________________________________________________________________________________________ *** CID 1501608: Control flow issues (DEADCODE) /src/northbridge/intel/haswell/native_raminit/raminit_main.c: 66 in try_raminit() 60 const struct task_entry *const schedule = cold_boot; 61 const size_t length = ARRAY_SIZE(cold_boot); 62 63 enum raminit_status status = RAMINIT_STATUS_UNSPECIFIED_ERROR; 64 65 for (size_t i = 0; i < length; i++) {
CID 1501608: Control flow issues (DEADCODE) Execution cannot reach this statement: "entry = &schedule[i];".
66 const struct task_entry *const entry = &schedule[i]; 67 assert(entry); 68 assert(entry->name); 69 if (!entry->is_enabled) 70 continue; 71
** CID 1501607: Code maintainability issues (UNUSED_VALUE) /src/northbridge/intel/haswell/native_raminit/raminit_native.c: 200 in perform_raminit()
________________________________________________________________________________________________________ *** CID 1501607: Code maintainability issues (UNUSED_VALUE) /src/northbridge/intel/haswell/native_raminit/raminit_native.c: 200 in perform_raminit() 194 /* 195 * The 'other' success value is to report loss of memory 196 * consistency to ME if warm boot was downgraded to cold. 197 */ 198 uint8_t me_status; 199 if (BOOTMODE_WARM == orig_bootmode && BOOTMODE_COLD == bootmode)
CID 1501607: Code maintainability issues (UNUSED_VALUE) Assigning value "3" to "me_status" here, but that stored value is overwritten before it can be used.
200 me_status = ME_INIT_STATUS_SUCCESS_OTHER; 201 else 202 me_status = ME_INIT_STATUS_SUCCESS; 203 204 /** TODO: Remove this once raminit is implemented **/ 205 me_status = ME_INIT_STATUS_ERROR;
** CID 1501606: Integer handling issues (BAD_SHIFT) /src/lib/fw_config.c: 69 in fw_config_get_field()
________________________________________________________________________________________________________ *** CID 1501606: Integer handling issues (BAD_SHIFT) /src/lib/fw_config.c: 69 in fw_config_get_field() 63 { 64 /* If fw_config is not provisioned, then there is nothing to get. */ 65 if (!fw_config_is_provisioned()) 66 return UNDEFINED_FW_CONFIG; 67 68 int shift = __ffs64(field->mask);
CID 1501606: Integer handling issues (BAD_SHIFT) In expression "(fw_config_get() & field->mask) >> shift", shifting by a negative amount has undefined behavior. The shift amount, "shift", is -1.
69 const uint64_t value = (fw_config_get() & field->mask) >> shift; 70 71 printk(BIOS_INFO, "fw_config get field name=%s, mask=0x%" PRIx64 ", shift=%d, value=0x%" 72 PRIx64 "\n", field->field_name, field->mask, shift, value); 73 74 return value;
________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0...