diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2022-01-14 13:24:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-15 14:14:40 +0200 |
commit | eeccbbde9695f0562ad342f0e0375134a7ba9d39 (patch) | |
tree | 0a9963a0826230203197ea51816b79dfafe0dfa4 /drivers | |
parent | 1bca3be5fb8272402d40ac0b25852570fc8fa4f4 (diff) | |
download | linux-stable-eeccbbde9695f0562ad342f0e0375134a7ba9d39.tar.gz linux-stable-eeccbbde9695f0562ad342f0e0375134a7ba9d39.tar.bz2 linux-stable-eeccbbde9695f0562ad342f0e0375134a7ba9d39.zip |
ACPI: properties: Consistently return -ENOENT if there are no more references
commit babc92da5928f81af951663fc436997352e02d3a upstream.
__acpi_node_get_property_reference() is documented to return -ENOENT if
the caller requests a property reference at an index that does not exist,
not -EINVAL which it actually does.
Fix this by returning -ENOENT consistenly, independently of whether the
property value is a plain reference or a package.
Fixes: c343bc2ce2c6 ("ACPI: properties: Align return codes of __acpi_node_get_property_reference()")
Cc: 4.14+ <stable@vger.kernel.org> # 4.14+
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/property.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 27db1a968241..c8018d73d5a7 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -618,7 +618,7 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode, */ if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) { if (index) - return -EINVAL; + return -ENOENT; ret = acpi_bus_get_device(obj->reference.handle, &device); if (ret) |