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

Commit af49d71f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: BA: Fix race condition with v4l2 event handler"

parents 372673ed bf87ee15
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -773,6 +773,8 @@ void *msm_ba_open(const struct msm_ba_ext_ops *ext_ops)
		inst->sd = list_first_entry(&(inst->dev_ctxt->v4l2_dev.subdevs),
			struct v4l2_subdev, list);

	msm_ba_setup_event_queue(inst, dev_ctxt->vdev);

	mutex_lock(&dev_ctxt->dev_cs);
	list_add_tail(&inst->list, &dev_ctxt->instances);
	mutex_unlock(&dev_ctxt->dev_cs);
@@ -788,8 +790,6 @@ void *msm_ba_open(const struct msm_ba_ext_ops *ext_ops)

	inst->ext_ops = ext_ops;

	msm_ba_setup_event_queue(inst, dev_ctxt->vdev);

	return inst;
}
EXPORT_SYMBOL(msm_ba_open);
@@ -805,7 +805,6 @@ int msm_ba_close(void *instance)

	if (!inst)
		return -EINVAL;
	v4l2_fh_del(&inst->event_handler);

	dev_ctxt = inst->dev_ctxt;
	mutex_lock(&dev_ctxt->dev_cs);
@@ -818,6 +817,10 @@ int msm_ba_close(void *instance)
	mutex_unlock(&dev_ctxt->dev_cs);

	msm_ba_ctrl_deinit(inst);

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

	debugfs_remove_recursive(inst->debugfs_root);

	dprintk(BA_DBG, "Closed BA instance: %p", inst);