This patch fixes a memory leak in an error path. Reported-by: Adrian Bunk <bunk@xxxxxxxxxx> Signed-off-by: Adrian Bunk <bunk@xxxxxxxxxx> --- 446be2de05a8c1fbf2208311673a19aaf26b188e diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c index bd57738..f03410c 100644 --- a/drivers/acpi/namespace/nsnames.c +++ b/drivers/acpi/namespace/nsnames.c @@ -150,20 +150,21 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) name_buffer = ACPI_ALLOCATE_ZEROED(size); if (!name_buffer) { ACPI_ERROR((AE_INFO, "Allocation failure")); return_PTR(NULL); } /* Build the path in the allocated buffer */ status = acpi_ns_build_external_path(node, size, name_buffer); if (ACPI_FAILURE(status)) { + ACPI_FREE(name_buffer); return (NULL); } return_PTR(name_buffer); } #endif /******************************************************************************* * * FUNCTION: acpi_ns_get_pathname_length -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html