Commit 23db673d authored by Colin Ian King's avatar Colin Ian King Committed by Rafael J. Wysocki

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: a9e10e58 ("ACPI: scan: Extend acpi_walk_dep_device_list()")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarDaniel Scally <djrscally@gmail.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b83e2b30
......@@ -2150,7 +2150,7 @@ int acpi_walk_dep_device_list(acpi_handle handle,
void *data)
{
struct acpi_dep_data *dep, *tmp;
int ret;
int ret = 0;
mutex_lock(&acpi_dep_list_lock);
list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment