vkr: fix a potential deadlock in vkr_context_submit_cmd

Fixes: 0432a54 ("vkr: check decoder status before decoding")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
macos/master
Chia-I Wu 3 years ago
parent f2ab66c6c0
commit fd1c39b0a3
  1. 4
      src/venus/vkr_context.c

@ -200,8 +200,10 @@ vkr_context_submit_cmd(struct virgl_context *base, const void *buffer, size_t si
mtx_lock(&ctx->mutex);
/* CS error is considered fatal (destroy the context?) */
if (vkr_cs_decoder_get_fatal(&ctx->decoder))
if (vkr_cs_decoder_get_fatal(&ctx->decoder)) {
mtx_unlock(&ctx->mutex);
return EINVAL;
}
vkr_cs_decoder_set_stream(&ctx->decoder, buffer, size);

Loading…
Cancel
Save