mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
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: 2a5ab99847 ("ACPICA: struct acpi_nfit_interleave: Replace 1-element array with flexible array")
Cc: stable@vger.kernel.org # v6.4+
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20230826071654.564372-1-liaoyu15@huawei.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
parent
6465e260f4
commit
33908660e8
|
|
@ -855,7 +855,7 @@ static size_t sizeof_idt(struct acpi_nfit_interleave *idt)
|
|||
{
|
||||
if (idt->header.length < sizeof(*idt))
|
||||
return 0;
|
||||
return sizeof(*idt) + sizeof(u32) * (idt->line_count - 1);
|
||||
return sizeof(*idt) + sizeof(u32) * idt->line_count;
|
||||
}
|
||||
|
||||
static bool add_idt(struct acpi_nfit_desc *acpi_desc,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user