frontends/va: Fix missing unlock
authorVinson Lee <vlee@freedesktop.org>
Wed, 7 Jun 2023 06:16:19 +0000 (23:16 -0700)
committerMarge Bot <emma+marge@anholt.net>
Sat, 10 Jun 2023 06:01:59 +0000 (06:01 +0000)
Fix defect reported by Coverity Scan.

Missing unlock (LOCK)
missing_unlock: Returning without unlocking drv->mutex.

Fixes: af695149e96 ("frontends/va: pass in film_grain_target as new output")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23488>

src/gallium/frontends/va/picture.c

index e7d4454..fdce7d6 100644 (file)
@@ -925,8 +925,10 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
 
    mtx_lock(&drv->mutex);
    surf = handle_table_get(drv->htab, output_id);
-   if (!surf || !surf->buffer)
+   if (!surf || !surf->buffer) {
+      mtx_unlock(&drv->mutex);
       return VA_STATUS_ERROR_INVALID_SURFACE;
+   }
 
    if (apply_av1_fg) {
       surf->ctx = context_id;