Skip to content

Commit

Permalink
acpidump: improve length calculation for several IVHD elements
Browse files Browse the repository at this point in the history
Use sizeofs of structures corresponding to the parsed device entry.
This does not change the calculation, but fixes logical inconsistency.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	Advanced Micro Devices (AMD)
MFC after:	1 week
  • Loading branch information
kostikbel committed May 31, 2024
1 parent 6e02784 commit 1eb7099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usr.sbin/acpi/acpidump/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,8 +1629,8 @@ acpi_handle_ivrs_ivhd_devs(ACPI_IVRS_DE_HEADER *d, char *de)
} else if (d->Type == ACPI_IVRS_TYPE_EXT_START) {
d8b = (ACPI_IVRS_DEVICE8B *)db;
len = sizeof(*d8b);
d4 = (ACPI_IVRS_DEVICE4 *)(db + sizeof(*d8a));
len = sizeof(*d8a) + sizeof(*d4);
d4 = (ACPI_IVRS_DEVICE4 *)(db + sizeof(*d8b));
len = sizeof(*d8b) + sizeof(*d4);
printf("\t\tDev Type=%#x Id=%#06x-%#06x",
d8a->Header.Type, d8a->Header.Id, d4->Header.Id);
acpi_handle_ivrs_ivhd_dte(d8b->Header.DataSetting);
Expand Down

0 comments on commit 1eb7099

Please sign in to comment.