diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-29 17:21:43 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-30 14:22:51 +0200 |
commit | d5008ef5b5a21177d3042816542f1afd5ae36152 (patch) | |
tree | c5d2b05e6e91a93f7b74db9a1f3d2abbc187cb72 /include/acpi | |
parent | 62fcb99bdf10fed34b4fe6e225489fe4be2d0536 (diff) | |
download | lwn-d5008ef5b5a21177d3042816542f1afd5ae36152.tar.gz lwn-d5008ef5b5a21177d3042816542f1afd5ae36152.zip |
ACPI: PM: Fix NULL argument handling in acpi_device_get/set_power()
In principle, it should be valid to pass NULL as the ACPI device
pointer to acpi_device_get_power() and acpi_device_set_power() and they
both are expected to return -EINVAL in that case, but that has been
broken recently by commit 62fcb99bdf10 ("ACPI: Drop parent field from
struct acpi_device") which has caused the ACPI device pointer to be
dereferenced in these functions before the NULL check.
Fix that and while at it make acpi_device_set_power() only use the
parent field if the target ACPI device object's ignore_parent flag
in not set.
Fixes: 62fcb99bdf10 ("ACPI: Drop parent field from struct acpi_device")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
0 files changed, 0 insertions, 0 deletions