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

Commit 91f28b17 authored by Praneeth Paladugu's avatar Praneeth Paladugu Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Bug fix in instance clean-up



When close is called directly without proper state operations,
then driver tries to clean all V4L2 framework memory. When driver
calls queue_release, it tries to call stream_off again. This
causes driver to re-enter the state operations. This change
prevents driver to re-enter the state diagram.

Change-Id: I6df248792fca78fe743bead311fa1cec61a6bb79
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
parent 01364e16
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1255,6 +1255,9 @@ int msm_vidc_close(void *instance)
	else if (inst->session_type == MSM_VIDC_ENCODER)
		msm_venc_ctrl_deinit(inst);

	for (i = 0; i < MAX_PORT_NUM; i++)
		vb2_queue_release(&inst->bufq[i].vb2_bufq);

	cleanup_instance(inst);
	if (inst->state != MSM_VIDC_CORE_INVALID &&
		core->state != VIDC_CORE_INVALID)
@@ -1264,8 +1267,6 @@ int msm_vidc_close(void *instance)
	if (rc)
		dprintk(VIDC_ERR,
			"Failed to move video instance to uninit state\n");
	for (i = 0; i < MAX_PORT_NUM; i++)
		vb2_queue_release(&inst->bufq[i].vb2_bufq);

	pr_info(VIDC_DBG_TAG "Closed video instance: %p\n", VIDC_INFO, inst);
	kfree(inst);