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

Commit e4798a55 authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: Fail qbuf and prepare_buf incase of error



If either instance state or core state is invalid, then
we should fail and return error from qbuf and prepare_buf.

CRs-Fixed: 1072500

Change-Id: I0efc3125b2c204dafbc90d011a4e9ad3fb1c1ba2
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent e2787f51
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -685,7 +685,11 @@ int msm_vidc_prepare_buf(void *instance, struct v4l2_buffer *b)
{
	struct msm_vidc_inst *inst = instance;

	if (!inst || !b || !valid_v4l2_buffer(b, inst))
	if (!inst || !inst->core || !b || !valid_v4l2_buffer(b, inst))
		return -EINVAL;

	if (inst->state == MSM_VIDC_CORE_INVALID ||
		inst->core->state == VIDC_CORE_INVALID)
		return -EINVAL;

	if (is_dynamic_output_buffer_mode(b, inst))
@@ -807,7 +811,11 @@ int msm_vidc_qbuf(void *instance, struct v4l2_buffer *b)
	int rc = 0;
	int i;

	if (!inst || !b || !valid_v4l2_buffer(b, inst))
	if (!inst || !inst->core || !b || !valid_v4l2_buffer(b, inst))
		return -EINVAL;

	if (inst->state == MSM_VIDC_CORE_INVALID ||
		inst->core->state == VIDC_CORE_INVALID)
		return -EINVAL;

	rc = map_and_register_buf(inst, b);