mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
msm: vidc: Add state check to allow flush command
Entry field from clock data structure gets initialized with codec data during state transition from MSM_VIDC_CORE_INIT_DONE to MSM_VIDC_OPEN. When flush is called before this transaction, it calls msm_clock_data_reset where mentioned field is getting accessed, which results in uninitialized data access. Add state check to ensure the command is handled in right sequence. Change-Id: Ic98221cbfe465415d89a0e2891f8af65f584f1dc Signed-off-by: Aniket Masule <amasule@codeaurora.org>
This commit is contained in:
parent
37915f1982
commit
1a50269424
2 changed files with 9 additions and 1 deletions
|
|
@ -1099,7 +1099,7 @@ void msm_clock_data_reset(struct msm_vidc_inst *inst)
|
|||
|
||||
dprintk(VIDC_DBG, "Init DCVS Load\n");
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst || !inst->core || !inst->clk_data.entry) {
|
||||
dprintk(VIDC_ERR, "%s Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -5091,6 +5091,14 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags)
|
|||
"Invalid params, inst %pK\n", inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->state < MSM_VIDC_OPEN_DONE) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid state to call flush, inst %pK, state %#x\n",
|
||||
inst, inst->state);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
core = inst->core;
|
||||
hdev = core->device;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue