diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-09-15 20:29:50 +0200 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-09-16 19:51:37 +0200 |
| commit | 0f83b1d436c98083dcbf7f3e6204015ed4a46743 (patch) | |
| tree | db462e39b59a29cc4d2b636951d52d844a444cf7 | |
| parent | baf60d5cb8bc6b85511c5df5f0ad7620bb66d23c (diff) | |
ACPI: property: Adjust failure handling in acpi_nondev_subnode_extract()
Make acpi_nondev_subnode_extract() follow the usual code flow pattern
in which failure is handled at the point where it is detected.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
| -rw-r--r-- | drivers/acpi/property.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index c086786fe84c..54baa23a9e5a 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -123,20 +123,21 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc, if (acpi_enumerate_nondev_subnodes(scope, desc, &dn->data, &dn->fwnode)) result = true; - if (result) { - /* - * This will be NULL if the desc package is embedded in an outer - * _DSD-equivalent package and its scope cannot be determined. - */ - dn->handle = handle; - dn->data.pointer = desc; - list_add_tail(&dn->sibling, list); - return true; + if (!result) { + kfree(dn); + acpi_handle_debug(handle, "Invalid properties/subnodes data, skipping\n"); + return false; } - kfree(dn); - acpi_handle_debug(handle, "Invalid properties/subnodes data, skipping\n"); - return false; + /* + * This will be NULL if the desc package is embedded in an outer + * _DSD-equivalent package and its scope cannot be determined. + */ + dn->handle = handle; + dn->data.pointer = desc; + list_add_tail(&dn->sibling, list); + + return true; } static bool acpi_nondev_subnode_ok(acpi_handle scope, |
