Rafael J. Wysocki 10fa1b2cdc ACPI: bus: Avoid non-ACPI device objects in walks over children
When walking the children of an ACPI device, take extra care to avoid
using to_acpi_device() on the ones that are not ACPI devices, because
that may lead to out-of-bounds access and memory corruption.

While at it, make the function passed to acpi_dev_for_each_child()
take a struct acpi_device pointer argument (instead of a struct device
one), so it is more straightforward to use.

Fixes: b7dd6298db81 ("ACPI: PM: Introduce acpi_dev_power_up_children_with_adr()")
Reported-by: kernel test robot <oliver.sang@intel.com>
BugLink: https://lore.kernel.org/lkml/20220420064725.GB16310@xsang-OptiPlex-9020/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2022-04-22 18:19:44 +02:00
..
2022-01-17 19:45:38 +01:00
2022-01-12 15:57:59 -08:00
2022-03-25 12:14:39 -07:00
2022-01-12 19:40:31 +01:00
2021-06-23 19:27:50 +02:00
2020-11-09 19:25:20 +01:00
2022-01-22 08:33:37 +02:00
2021-06-07 15:36:46 +02:00
2020-11-09 19:08:06 +01:00
2022-03-21 14:26:28 -07:00
2021-06-25 15:02:43 +02:00
2020-11-09 19:08:06 +01:00