diff mbox series

ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node)

Message ID 20230201021213.GC446@altlinux.org
State New
Headers show
Series ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node) | expand

Commit Message

Alexey V. Vissarionov Feb. 1, 2023, 2:12 a.m. UTC
The node is a pointer to struct acpi_iort_node, so it's just 4 or 8
bytes, while the structure itself is several times bigger.

Found by ALT Linux Team (altlinux.org) and Linux Verification Center
(linuxtesting.org) using SVACE.

Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>
Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG")

---
diff mbox series

Patch

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 38fb84974f352cc8..edb94b52bf3a21ce 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -1832,7 +1832,8 @@  static int __init iort_add_platform_device(struct acpi_iort_node *node,
 	if (ops->dev_add_platdata)
 		ret = ops->dev_add_platdata(pdev);
 	else
-		ret = platform_device_add_data(pdev, &node, sizeof(node));
+		ret = platform_device_add_data(pdev, &node,
+						sizeof(struct acpi_iort_node));
 
 	if (ret)
 		goto dev_put;