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

Alex Hung alex.hung at canonical.com
Thu May 9 05:36:24 UTC 2013


On 05/07/2013 04:28 PM, Colin King 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;
>
Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list