Commit 6a52f4cf authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'acpi-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Modify a helper function in the ACPI core to match the behavior
  expected by its users so as to prevent NULL pointer dereferences and
  occasional memory corruption from occurring (Hans de Goede)"

* tag 'acpi-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: scan: Make acpi_bus_get_device() clear return pointer on error
parents 120fbdb8 78a18fec
...@@ -586,6 +586,8 @@ static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device, ...@@ -586,6 +586,8 @@ static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device,
if (!device) if (!device)
return -EINVAL; return -EINVAL;
*device = NULL;
status = acpi_get_data_full(handle, acpi_scan_drop_device, status = acpi_get_data_full(handle, acpi_scan_drop_device,
(void **)device, callback); (void **)device, callback);
if (ACPI_FAILURE(status) || !*device) { if (ACPI_FAILURE(status) || !*device) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment