st/va: release held locks in error paths
authorGrazvydas Ignotas <notasas@gmail.com>
Mon, 15 Jan 2018 21:59:20 +0000 (23:59 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Tue, 16 Jan 2018 22:39:55 +0000 (00:39 +0200)
commit0ad73031ec2f9dee6d3ad20dd625b0134ea8ec8b
treedec750458da9b93f2397750becdcc4900448a11c
parentcce982a70be5e24c6f6ee222c17c47eb8cba6921
st/va: release held locks in error paths

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
src/gallium/state_trackers/va/config.c
src/gallium/state_trackers/va/image.c
src/gallium/state_trackers/va/picture.c