Skip to content

Commit 23db673

Browse files
Colin Ian Kingrafaeljw
authored andcommitted
ACPI: scan: initialize local variable to avoid garbage being returned
In the unlikely event that there are no callback calls made in acpi_walk_dep_device_list(), local variable ret will be returned as an uninitialized value. Clean up static analysis warnings by ensuring ret is initialized. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: a9e10e5 ("ACPI: scan: Extend acpi_walk_dep_device_list()") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Daniel Scally <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b83e2b3 commit 23db673

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2150,7 +2150,7 @@ int acpi_walk_dep_device_list(acpi_handle handle,
21502150
void *data)
21512151
{
21522152
struct acpi_dep_data *dep, *tmp;
2153-
int ret;
2153+
int ret = 0;
21542154

21552155
mutex_lock(&acpi_dep_list_lock);
21562156
list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {

0 commit comments

Comments
 (0)