Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71438444 authored by Govindaraj Rajagopal's avatar Govindaraj Rajagopal
Browse files

msm: vidc: ensure vidc instance is valid before using



Timer fired at the same time instance is freed. So check validity of
vidc instance before using.

Change-Id: Id0343e761cacdba9de7d89d3814530d478375947
Signed-off-by: default avatarGovindaraj Rajagopal <grajagop@codeaurora.org>
parent 9bf3f2e7
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -4377,6 +4377,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__);
@@ -4389,6 +4401,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,