ACPICA: Fix possible dereference of null pointer
authorBob Moore <robert.moore@intel.com>
Wed, 22 Apr 2009 04:57:40 +0000 (12:57 +0800)
committerLen Brown <len.brown@intel.com>
Wed, 27 May 2009 04:30:49 +0000 (00:30 -0400)
Fix dereference of possibly null pointer "Predefined" in the case
where the method is not one of the predefined methods.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/acpica/nspredef.c

index d9e8cbc..7f8e066 100644 (file)
@@ -144,7 +144,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
 
        pathname = acpi_ns_get_external_pathname(node);
        if (!pathname) {
-               pathname = ACPI_CAST_PTR(char, predefined->info.name);
+               return AE_OK;   /* Could not get pathname, ignore */
        }
 
        /*
@@ -230,10 +230,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
        }
 
       exit:
-       if (pathname != predefined->info.name) {
-               ACPI_FREE(pathname);
-       }
-
+       ACPI_FREE(pathname);
        return (status);
 }