Skip to content

Commit 87b3b6d

Browse files
rmurphy-armwilldeacon
authored andcommitted
ACPI/APMT: Don't register invalid resource
Don't register a resource for the second page unless the dual-page extension flag is actually present to say it's valid. CC: Lorenzo Pieralisi <[email protected]> CC: Sudeep Holla <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Reviewed-by: Hanjun Guo <[email protected]> Reviewed-and-tested-by: Ilkka Koskinen <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Acked-by: Lorenzo Pieralisi <[email protected]> Link: https://lore.kernel.org/r/63b34656e1f7b41bcb458fb6d7496e04db757e0d.1685983270.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent 71e0cb3 commit 87b3b6d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/acpi/arm64/apmt.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ static int __init apmt_init_resources(struct resource *res,
3535

3636
num_res++;
3737

38-
res[num_res].start = node->base_address1;
39-
res[num_res].end = node->base_address1 + SZ_4K - 1;
40-
res[num_res].flags = IORESOURCE_MEM;
38+
if (node->flags & ACPI_APMT_FLAGS_DUAL_PAGE) {
39+
res[num_res].start = node->base_address1;
40+
res[num_res].end = node->base_address1 + SZ_4K - 1;
41+
res[num_res].flags = IORESOURCE_MEM;
4142

42-
num_res++;
43+
num_res++;
44+
}
4345

4446
if (node->ovflw_irq != 0) {
4547
trigger = (node->ovflw_irq_flags & ACPI_APMT_OVFLW_IRQ_FLAGS_MODE);

0 commit comments

Comments
 (0)