summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-06-05 04:34:44 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-06-05 04:34:44 -0700
commit5b46d743add412d48cce17c35f7976526635b747 (patch)
tree3b1c7faac038c96f0fa05ef4abb8c05668ab2489
parentb22aa202143fb7d8d18e847bda7dd6ef5990eeaf (diff)
parentdf5936a471697ac1df3cb61174b65ae1c3f935bf (diff)
Merge "msm: vidc: Add state checks for start streaming"
-rw-r--r--drivers/media/platform/msm/vidc/msm_vdec.c10
-rw-r--r--drivers/media/platform/msm/vidc/msm_venc.c10
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/media/platform/msm/vidc/msm_vdec.c b/drivers/media/platform/msm/vidc/msm_vdec.c
index 85afcf790ae1..8ac84ece2c2a 100644
--- a/drivers/media/platform/msm/vidc/msm_vdec.c
+++ b/drivers/media/platform/msm/vidc/msm_vdec.c
@@ -872,7 +872,7 @@ int msm_vdec_prepare_buf(struct msm_vidc_inst *inst,
dprintk(VIDC_ERR,
"Core %pK in bad state, ignoring prepare buf\n",
inst->core);
- goto exit;
+ return -EINVAL;
}
switch (b->type) {
@@ -925,7 +925,7 @@ int msm_vdec_prepare_buf(struct msm_vidc_inst *inst,
dprintk(VIDC_ERR, "Buffer type not recognized: %d\n", b->type);
break;
}
-exit:
+
return rc;
}
@@ -1778,6 +1778,12 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
return -EINVAL;
}
+
+ if (inst->state == MSM_VIDC_CORE_INVALID ||
+ inst->core->state == VIDC_CORE_INVALID ||
+ inst->core->state == VIDC_CORE_UNINIT)
+ return -EINVAL;
+
hdev = inst->core->device;
dprintk(VIDC_DBG, "Streamon called on: %d capability for inst: %pK\n",
q->type, inst);
diff --git a/drivers/media/platform/msm/vidc/msm_venc.c b/drivers/media/platform/msm/vidc/msm_venc.c
index 49331958f478..cdf91dd80ed3 100644
--- a/drivers/media/platform/msm/vidc/msm_venc.c
+++ b/drivers/media/platform/msm/vidc/msm_venc.c
@@ -1905,6 +1905,12 @@ static int msm_venc_start_streaming(struct vb2_queue *q, unsigned int count)
return -EINVAL;
}
inst = q->drv_priv;
+
+ if (inst->state == MSM_VIDC_CORE_INVALID ||
+ inst->core->state == VIDC_CORE_INVALID ||
+ inst->core->state == VIDC_CORE_UNINIT)
+ return -EINVAL;
+
dprintk(VIDC_DBG, "Streamon called on: %d capability for inst: %pK\n",
q->type, inst);
switch (q->type) {
@@ -4429,7 +4435,7 @@ int msm_venc_prepare_buf(struct msm_vidc_inst *inst,
dprintk(VIDC_ERR,
"Core %pK in bad state, ignoring prepare buf\n",
inst->core);
- goto exit;
+ return -EINVAL;
}
switch (b->type) {
@@ -4477,7 +4483,7 @@ int msm_venc_prepare_buf(struct msm_vidc_inst *inst,
"Buffer type not recognized: %d\n", b->type);
break;
}
-exit:
+
return rc;
}