Skip to content

Commit 3390866

Browse files
yuliao0214davejiang
authored andcommitted
ACPI: NFIT: Fix incorrect calculation of idt size
acpi_nfit_interleave's field 'line_offset' is switched to flexible array [1], but sizeof_idt() still calculates the size in the form of 1-element array. Therefore, fix incorrect calculation in sizeof_idt(). [1] https://lore.kernel.org/lkml/2652195.BddDVKsqQX@kreacher/ Fixes: 2a5ab99 ("ACPICA: struct acpi_nfit_interleave: Replace 1-element array with flexible array") Cc: [email protected] # v6.4+ Signed-off-by: Yu Liao <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent 6465e26 commit 3390866

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/nfit/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ static size_t sizeof_idt(struct acpi_nfit_interleave *idt)
855855
{
856856
if (idt->header.length < sizeof(*idt))
857857
return 0;
858-
return sizeof(*idt) + sizeof(u32) * (idt->line_count - 1);
858+
return sizeof(*idt) + sizeof(u32) * idt->line_count;
859859
}
860860

861861
static bool add_idt(struct acpi_nfit_desc *acpi_desc,

0 commit comments

Comments
 (0)