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

Commit f73b186f authored by Arun Menon's avatar Arun Menon Committed by Gerrit - the friendly Code Review server
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: 973430

Change-Id: I925161cf70726f1f3d4d2abd5b1c84db204d7996
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 410e920b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -693,7 +693,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))
@@ -815,7 +819,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);