diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-08-10 13:38:08 +0200 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-08-14 21:49:45 +0200 |
| commit | a9ba4dd2f18bf3f439d9ef0d8f375f90360ba1bd (patch) | |
| tree | 670d03ef28b482cdf407e8d78697f4dcb5689fa2 /rust/kernel | |
| parent | 72530e1f72b0515a73fd88292254d04fecf03649 (diff) | |
ACPI: platform: Use acpi_bus_get_primary_device()
The acpi_get_first_physical_node() usage in acpi_platform_fill_resource()
and acpi_create_platform_device() is generally unsafe because in theory
the device returned by it may be freed at any time [1].
It is also inefficient because acpi_get_first_physical_node() is called
multiple times for the same argument which can be avoided.
Address these issues by using acpi_bus_get_primary_device() instead of
acpi_get_first_physical_node() and adjusting the code to call it just
once at the beginning of and acpi_create_platform_device() and drop
the device reference acquired by it upon the return from that function.
Fixes: 3b95bd160547 ("ACPI: introduce a function to find the first physical device")
Fixes: a252d881c558 ("ACPI / platform: Pay attention to parent device's resources")
Link: https://sashiko.dev/#/patchset/12955541.O9o76ZdvQC%40rafael.j.wysocki [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/3436112.aeNJFYEL58@rafael.j.wysocki
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions
