Skip to content

Commit 0f83b1d

Browse files
committed
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>
1 parent baf60d5 commit 0f83b1d

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

drivers/acpi/property.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,21 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc,
123123
if (acpi_enumerate_nondev_subnodes(scope, desc, &dn->data, &dn->fwnode))
124124
result = true;
125125

126-
if (result) {
127-
/*
128-
* This will be NULL if the desc package is embedded in an outer
129-
* _DSD-equivalent package and its scope cannot be determined.
130-
*/
131-
dn->handle = handle;
132-
dn->data.pointer = desc;
133-
list_add_tail(&dn->sibling, list);
134-
return true;
126+
if (!result) {
127+
kfree(dn);
128+
acpi_handle_debug(handle, "Invalid properties/subnodes data, skipping\n");
129+
return false;
135130
}
136131

137-
kfree(dn);
138-
acpi_handle_debug(handle, "Invalid properties/subnodes data, skipping\n");
139-
return false;
132+
/*
133+
* This will be NULL if the desc package is embedded in an outer
134+
* _DSD-equivalent package and its scope cannot be determined.
135+
*/
136+
dn->handle = handle;
137+
dn->data.pointer = desc;
138+
list_add_tail(&dn->sibling, list);
139+
140+
return true;
140141
}
141142

142143
static bool acpi_nondev_subnode_ok(acpi_handle scope,

0 commit comments

Comments
 (0)