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

Commit 0ec05e2b authored by Lynus Vaz's avatar Lynus Vaz Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: core: Destroy the context handle on shutdown



When the context is released, the handle is overwritten. As part of
the context shutdown sequence, save out the handle before releasing
it, and then explicitly destroy it.

Change-Id: I6ec81e7feb61f46cb0ffa27cedda26258857c5b9
Signed-off-by: default avatarLynus Vaz <lvaz@codeaurora.org>
parent 488bd904
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ static int cam_context_handle_hw_event(void *context, uint32_t evt_id,
int cam_context_shutdown(struct cam_context *ctx)
{
	int rc = 0;
	int32_t ctx_hdl = ctx->dev_hdl;

	if (ctx->state_machine[ctx->state].ioctl_ops.stop_dev) {
		rc = ctx->state_machine[ctx->state].ioctl_ops.stop_dev(
@@ -54,6 +55,8 @@ int cam_context_shutdown(struct cam_context *ctx)
			CAM_ERR(CAM_CORE, "Error while dev release %d", rc);
	}

	if (!rc)
		cam_destroy_device_hdl(ctx_hdl);
	return rc;
}

+0 −1
Original line number Diff line number Diff line
@@ -381,7 +381,6 @@ int cam_node_shutdown(struct cam_node *node)
	for (i = 0; i < node->ctx_size; i++) {
		if (node->ctx_list[i].dev_hdl >= 0) {
			cam_context_shutdown(&(node->ctx_list[i]));
			cam_destroy_device_hdl(node->ctx_list[i].dev_hdl);
			cam_context_putref(&(node->ctx_list[i]));
		}
	}