Skip to content

Commit 7ad5ccc

Browse files
Sakari Ailusgregkh
authored andcommitted
ACPI: properties: Consistently return -ENOENT if there are no more references
commit babc92d 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: c343bc2 ("ACPI: properties: Align return codes of __acpi_node_get_property_reference()") Cc: 4.14+ <[email protected]> # 4.14+ Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ef3a87e commit 7ad5ccc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/property.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
685685
*/
686686
if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) {
687687
if (index)
688-
return -EINVAL;
688+
return -ENOENT;
689689

690690
ret = acpi_bus_get_device(obj->reference.handle, &device);
691691
if (ret)

0 commit comments

Comments
 (0)