ACPI: properties: Consistently return -ENOENT if there are no more references
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 14 Jan 2022 11:24:49 +0000 (13:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:22:58 +0000 (14:22 +0200)
commit8a7f9d9c3f6adacb5ac393deb4b83ed8851b8b07
tree72c18902fb954ebf399fa412d425720af465db2d
parent2e2eb55823df54b284acc365e0e5ad06d615d162
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>
drivers/acpi/property.c