All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] acpi_ns_get_external_pathname(): fix a memory leak
@ 2008-08-27 22:03 Adrian Bunk
  2008-08-28 19:36 ` Moore, Robert
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2008-08-27 22:03 UTC (permalink / raw)
  To: Bob Moore, Lin Ming, Andi Kleen, lenb; +Cc: linux-acpi

This patch fixes a memory leak in an error path.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-28 20:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27 22:03 [2.6 patch] acpi_ns_get_external_pathname(): fix a memory leak Adrian Bunk
2008-08-28 19:36 ` Moore, Robert
2008-08-28 20:46   ` Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.