Found with the help of following Coccinelle semantic patch:
// <smpl>
@@
expression E;
@@
\(pthread_mutex_lock\|mtx_lock\|simple_mtx_lock\)(E)
...
(
\(pthread_mutex_unlock\|mtx_unlock\|simple_mtx_unlock\)(E);
...
return ...;
|
+ maybe need_unlock(E);
return ...;
)
// </smpl>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: mesa-stable@lists.freedesktop.org
mtx_lock(&drv->mutex);
config = handle_table_get(drv->htab, config_id);
- if (!config)
+ if (!config) {
+ mtx_unlock(&drv->mutex);
return VA_STATUS_ERROR_INVALID_CONFIG;
+ }
FREE(config);
handle_table_remove(drv->htab, config_id);
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_DISCARD_RANGE,
&dst_box, &transfer);
- if (map == NULL)
+ if (map == NULL) {
+ mtx_unlock(&drv->mutex);
return VA_STATUS_ERROR_OPERATION_FAILED;
+ }
u_copy_nv12_from_yv12((const void * const*) data, pitches, i, j,
transfer->stride, tex->array_size,
vl_compositor_yuv_deint_full(&drv->cstate, &drv->compositor,
old_buf, surf->buffer,
&src_rect, &dst_rect, VL_COMPOSITOR_WEAVE);
- } else
+ } else {
/* Can't convert from progressive to interlaced yet */
+ mtx_unlock(&drv->mutex);
return VA_STATUS_ERROR_INVALID_SURFACE;
+ }
}
old_buf->destroy(old_buf);