ACPICA: AML Parser: Fix two possible memory leaks in error path
authorJesper Juhl <jj@chaosbits.net>
Thu, 3 May 2012 01:38:10 +0000 (09:38 +0800)
committerLen Brown <len.brown@intel.com>
Fri, 1 Jun 2012 15:51:49 +0000 (11:51 -0400)
Fixes a couple of memory leaks in the error recovery path.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
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/psargs.c

index 5ac36ab..a683d66 100644 (file)
@@ -618,6 +618,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
 
                                arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP);
                                if (!arg) {
+                                       acpi_ps_free_op(field);
                                        return_PTR(NULL);
                                }
 
@@ -662,6 +663,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
                } else {
                        arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP);
                        if (!arg) {
+                               acpi_ps_free_op(field);
                                return_PTR(NULL);
                        }