ACPI: ec: add unlock in error path
authorAlexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Thu, 15 Feb 2007 20:16:18 +0000 (23:16 +0300)
committerLen Brown <len.brown@intel.com>
Fri, 16 Feb 2007 17:51:53 +0000 (12:51 -0500)
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/ec.c

index 743ce27fa0bbf2915c78f4d18fdefecb1fdf133a..8f5aaf753fdac7d81b5772fe8f5bff1e186941ac 100644 (file)
@@ -280,8 +280,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
        mutex_lock(&ec->lock);
        if (ec->global_lock) {
                status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
-               if (ACPI_FAILURE(status))
+               if (ACPI_FAILURE(status)) {
+                       mutex_unlock(&ec->lock);
                        return -ENODEV;
+               }
        }
 
        /* Make sure GPE is enabled before doing transaction */