ACPICA: _OSI support: Fix possible memory leak
authorJung-uk Kim <jkim@FreeBSD.org>
Wed, 8 May 2013 04:01:49 +0000 (04:01 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 8 May 2013 13:31:46 +0000 (15:31 +0200)
Fixes a possible memory leak in the error exit path introduced by
recent commit 388a990 ("ACPICA: _OSI Support: handle any errors from
acpi_os_acquire_mutex()").

[rjw: Changelog]
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/utosi.c

index b15acebb96a1590b9555942c53a6fe883e08b306..7e807725c636896aeeb83c3b35022eb2ad88848f 100644 (file)
@@ -349,7 +349,8 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state * walk_state)
        return_value = 0;
        status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
        if (ACPI_FAILURE(status)) {
-               return (status);
+               acpi_ut_remove_reference(return_desc);
+               return_ACPI_STATUS(status);
        }
 
        /* Lookup the interface in the global _OSI list */