From: Sakari Ailus Date: Fri, 14 Jan 2022 11:24:49 +0000 (+0200) Subject: ACPI: properties: Consistently return -ENOENT if there are no more references X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=923339c722f9f0557cec1fd6ea1e5e05a124e3a2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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+ # 4.14+ Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index da39117032df..94e1cac3997d 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -601,7 +601,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)