diff options
author | qctecmdr <qctecmdr@localhost> | 2019-06-04 13:24:11 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-06-04 13:24:11 -0700 |
commit | 16b667642e3a474c7c29eeb769f81b20906d783e (patch) | |
tree | bde39205f3cc0b9761ee153696dbfb35f61215ed | |
parent | d455fe60c491978aa6107b9034afd17eb7dafd76 (diff) | |
parent | c040b12e03e522fc586e1f6c724292d48ab41ce3 (diff) |
Merge "msm: vidc: ensure vidc instance is valid before using"LE.UM.2.4.1.c1-06900-qcs405.0LE.UM.2.4.1.c1-06700-qcs405.0
-rw-r--r-- | drivers/media/platform/msm/vidc/msm_vidc_common.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c index 734a5d8cc740..874802015606 100644 --- a/drivers/media/platform/msm/vidc/msm_vidc_common.c +++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c @@ -4376,6 +4376,18 @@ void msm_vidc_batch_handler(struct work_struct *work) struct msm_vidc_inst *inst; inst = container_of(work, struct msm_vidc_inst, batch_work); + + inst = get_inst(get_vidc_core(MSM_VIDC_CORE_VENUS), inst); + if (!inst) { + dprintk(VIDC_ERR, "%s: invalid params\n", __func__); + return; + } + + if (inst->state == MSM_VIDC_CORE_INVALID) { + dprintk(VIDC_ERR, "%s: invalid state\n", __func__); + goto exit; + } + rc = msm_comm_scale_clocks_and_bus(inst); if (rc) dprintk(VIDC_ERR, "%s: scale clocks failed\n", __func__); @@ -4388,6 +4400,9 @@ void msm_vidc_batch_handler(struct work_struct *work) dprintk(VIDC_ERR, "%s: Failed batch-qbuf to hfi: %d\n", __func__, rc); } + +exit: + put_inst(inst); } static int msm_comm_qbuf_in_rbr(struct msm_vidc_inst *inst, |