From e1d948b6a247a7c5d05c90a05b47e5675738a417 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 6 Jun 2023 23:16:19 -0700 Subject: [PATCH] frontends/va: Fix missing unlock 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 Reviewed-by: Boyuan Zhang Part-of: --- src/gallium/frontends/va/picture.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c index e7d445470e0..fdce7d66649 100644 --- a/src/gallium/frontends/va/picture.c +++ b/src/gallium/frontends/va/picture.c @@ -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;