From: Matthew Dillon Date: Mon, 15 Feb 2010 07:00:46 +0000 (-0800) Subject: kernel - ACPI - Fix missing unlocks in error path in acpi_ec X-Git-Tag: v2.7.1~134 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/ac779aee61cac645ac21dbec1d98f4e46a4a24f4 kernel - ACPI - Fix missing unlocks in error path in acpi_ec * Add missing unlocks Submitted-by: Edward O'Callaghan --- diff --git a/sys/dev/acpica5/acpi_ec.c b/sys/dev/acpica5/acpi_ec.c index 62132fc..e14732e 100644 --- a/sys/dev/acpica5/acpi_ec.c +++ b/sys/dev/acpica5/acpi_ec.c @@ -619,6 +619,7 @@ EcGpeQueryHandler(void *Context) /* Serialize user access with EcSpaceHandler(). */ Status = EcLock(sc); if (ACPI_FAILURE(Status)) { + EcUnlock(sc); device_printf(sc->ec_dev, "GpeQuery lock error: %s\n", AcpiFormatException(Status)); return; @@ -762,8 +763,10 @@ EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, /* Serialize with EcGpeQueryHandler() at transaction granularity. */ Status = EcLock(sc); - if (ACPI_FAILURE(Status)) + if (ACPI_FAILURE(Status)) { + EcUnlock(sc); return_ACPI_STATUS (Status); + } /* Perform the transaction(s), based on width. */ for (i = 0; i < width; i += 8, EcAddr++) {