Skip to content

Commit babc92d

Browse files
Sakari Ailusrafaeljw
authored andcommitted
ACPI: properties: Consistently return -ENOENT if there are no more references
__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+ <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>
1 parent e783362 commit babc92d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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
device = acpi_fetch_acpi_dev(obj->reference.handle);
691691
if (!device)

0 commit comments

Comments
 (0)