summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-09-27 11:12:36 +0800
committerLen Brown <len.brown@intel.com>2008-10-22 23:14:45 -0400
commit393a75d6b7bae59221b2122634eb4cb905e84208 (patch)
tree245820dfdec67e14c80500a555caf73c94a17406 /drivers/acpi
parent1044f1f65b7df2aae979e397904c4985eeb99ba2 (diff)
downloadlwn-393a75d6b7bae59221b2122634eb4cb905e84208.tar.gz
lwn-393a75d6b7bae59221b2122634eb4cb905e84208.zip
ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname
Fixes a memory leak in the error exit path. 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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/namespace/nsnames.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c
index bd5773878009..9c587bdfe3f3 100644
--- a/drivers/acpi/namespace/nsnames.c
+++ b/drivers/acpi/namespace/nsnames.c
@@ -142,7 +142,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
size = acpi_ns_get_pathname_length(node);
if (!size) {
- return (NULL);
+ return_PTR(NULL);
}
/* Allocate a buffer to be returned to caller */
@@ -157,7 +157,8 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
status = acpi_ns_build_external_path(node, size, name_buffer);
if (ACPI_FAILURE(status)) {
- return (NULL);
+ ACPI_FREE(name_buffer);
+ return_PTR(NULL);
}
return_PTR(name_buffer);