Commit 6a52f4cf authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -586,6 +586,8 @@ static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device,
	if (!device)
		return -EINVAL;

	*device = NULL;

	status = acpi_get_data_full(handle, acpi_scan_drop_device,
				    (void **)device, callback);
	if (ACPI_FAILURE(status) || !*device) {