MLK-22506: VPU Decoder: fix mutex may not unlock if v4l2_open fail
authorming_qian <ming.qian@nxp.com>
Tue, 27 Aug 2019 01:46:39 +0000 (09:46 +0800)
committerming_qian <ming.qian@nxp.com>
Tue, 27 Aug 2019 02:32:08 +0000 (10:32 +0800)
there is an bug in v4l2_open,
that the dev_mutex may be not unlock in some flow,
it'll cause dead lock.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
drivers/mxc/vpu_malone/vpu_b0.c

index 12f5a8b..9d3155b 100644 (file)
@@ -5837,6 +5837,7 @@ static int v4l2_open(struct file *filp)
                        if (!wait_for_completion_timeout(&ctx->dev->start_cmp, msecs_to_jiffies(10000))) {
                                vpu_err("error: don't get start interrupt\n");
                                ret = -1;
+                               mutex_unlock(&dev->dev_mutex);
                                goto err_firmware_load;
                        }
                }