ACPICA: Fix 'may be used uninitialized' warning in acpi_ns_repair_object()
authorBen Hutchings <ben@decadent.org.uk>
Mon, 6 Nov 2017 00:47:19 +0000 (00:47 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:34:41 +0000 (13:34 +0000)
gcc 4.7 warns that new_object may be used uninitialized in this
function.  In fact, all the cases where it's not initialised are
errors that will result in returning early without using it.
Silence the warning by initialising to NULL.

This was done upstream as part of commit d5a36100f62f "ACPICA: Add
mechanism for early object repairs on a per-name basis".

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/acpi/acpica/nsrepair.c

index ac7b854..9d1a5da 100644 (file)
@@ -121,7 +121,7 @@ acpi_ns_repair_object(struct acpi_predefined_data *data,
                      union acpi_operand_object **return_object_ptr)
 {
        union acpi_operand_object *return_object = *return_object_ptr;
-       union acpi_operand_object *new_object;
+       union acpi_operand_object *new_object = NULL;
        acpi_status status;
 
        ACPI_FUNCTION_NAME(ns_repair_object);