Hi,
Please find the latest report on new defect(s) introduced to coreboot found with Coverity Scan.
3 new defect(s) introduced to coreboot found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan Showing 3 of 3 defect(s)
** CID 1452766: Incorrect expression (SIZEOF_MISMATCH) /src/acpi/acpi.c: 914 in acpi_create_einj()
________________________________________________________________________________________________________ *** CID 1452766: Incorrect expression (SIZEOF_MISMATCH) /src/acpi/acpi.c: 914 in acpi_create_einj() 908 einj_smi->trigger_action_table = (u64) (uintptr_t)tat; 909 910 for (i = 0; i < ACTION_COUNT; i++) 911 printk(BIOS_DEBUG, "default_actions[%d].reg.addr is %llx\n", i, 912 default_actions[i].reg.addr); 913
CID 1452766: Incorrect expression (SIZEOF_MISMATCH) Passing argument "einj" of type "acpi_einj_t *" and argument "4UL /* sizeof (einj) */" to function "memset" is suspicious.
914 memset((void *)einj, 0, sizeof(einj)); 915 916 /* Fill out header fields. */ 917 memcpy(header->signature, "EINJ", 4); 918 memcpy(header->oem_id, OEM_ID, 6); 919 memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8);
** CID 1452765: Incorrect expression (SIZEOF_MISMATCH) /src/acpi/acpi.c: 810 in acpi_create_einj()
________________________________________________________________________________________________________ *** CID 1452765: Incorrect expression (SIZEOF_MISMATCH) /src/acpi/acpi.c: 810 in acpi_create_einj() 804 acpi_einj_trigger_table_t *tat; 805 if (!header) 806 return; 807 808 printk(BIOS_DEBUG, "%s einj_smi = %p\n", __func__, einj_smi); 809 memset(einj_smi, 0, sizeof(acpi_einj_smi_t));
CID 1452765: Incorrect expression (SIZEOF_MISMATCH) Adding "540UL /* sizeof (acpi_einj_smi_t) */" to pointer "einj_smi" of type "acpi_einj_smi_t *" is suspicious because adding an integral value to this pointer automatically scales that value by the size, 540 bytes, of the pointed-to type, "acpi_einj_smi_t". Most likely, "sizeof (acpi_einj_smi_t)" is extraneous and should be replaced with 1.
810 tat = (acpi_einj_trigger_table_t *)(einj_smi + sizeof(acpi_einj_smi_t)); 811 tat->header_size = 16; 812 tat->revision = 0; 813 tat->table_size = sizeof(acpi_einj_trigger_table_t) + 814 sizeof(acpi_einj_action_table_t) * actions - 1; 815 tat->entry_count = actions;
** CID 1452764: Incorrect expression (SIZEOF_MISMATCH) /src/acpi/acpi.c: 931 in acpi_create_einj()
________________________________________________________________________________________________________ *** CID 1452764: Incorrect expression (SIZEOF_MISMATCH) /src/acpi/acpi.c: 931 in acpi_create_einj() 925 inj_header->einj_header_size = sizeof(acpi_injection_header_t); 926 inj_header->entry_count = ACTION_COUNT; 927 928 printk(BIOS_DEBUG, "%s einj->action_table = %p\n", 929 __func__, einj->action_table); 930 memcpy((void *)einj->action_table, (void *)default_actions, sizeof(einj->action_table));
CID 1452764: Incorrect expression (SIZEOF_MISMATCH) Passing argument "einj" of type "acpi_einj_t *" and argument "4U /* sizeof (einj) */" to function "acpi_checksum" is suspicious.
931 header->checksum = acpi_checksum((void *)einj, sizeof(einj)); 932 } 933 934 void acpi_create_vfct(const struct device *device, 935 acpi_vfct_t *vfct, 936 unsigned long (*acpi_fill_vfct)(const struct device *device,
________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0...