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

Commit 7cf51cf9 authored by Arun Menon's avatar Arun Menon
Browse files

msm: vidc: Deinit v4l2 control handler at the very end



Deinit v4l2 control handler after removing the instance
node from the core instance list. Without this change,
there could arise a situation where driver passes down
freed v4l2 control handler to v4l2 framework causing a
crash.

Change-Id: Icfafeb55eb6a4515cea5f8d5deb9503b90888f03
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 718b9859
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1275,6 +1275,8 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst)
	list_del(&inst->list);
	mutex_unlock(&core->lock);

	msm_comm_ctrl_deinit(inst);

	v4l2_fh_del(&inst->event_handler);
	v4l2_fh_exit(&inst->event_handler);

@@ -1323,8 +1325,6 @@ int msm_vidc_close(void *instance)
	}
	mutex_unlock(&inst->registeredbufs.lock);

	msm_comm_ctrl_deinit(inst);

	cleanup_instance(inst);
	if (inst->state != MSM_VIDC_CORE_INVALID &&
		inst->core->state != VIDC_CORE_INVALID)