[PATCH] acpica: fwts_acpica: missing unlock on error path

Keng-Yu Lin kengyu at canonical.com
Mon May 20 07:33:43 UTC 2013


On Tue, May 7, 2013 at 4:28 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Coverity CID #997292: Missing unlock
>
> Forgot to unlock mutex_lock_sem_table if we cannot find
> any free semaphores on error path.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/acpica/fwts_acpica.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index 85ac735..73bfa73 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -509,8 +509,10 @@ ACPI_STATUS AcpiOsCreateSemaphore(UINT32 MaxUnits,
>                 }
>         }
>
> -       if (!sem)
> +       if (!sem) {
> +               pthread_mutex_unlock(&mutex_lock_sem_table);
>                 return AE_NO_MEMORY;
> +       }
>
>         sem->used = true;
>         sem->count = 0;
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list