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

Commit f19f0dbb authored by Harsh Shah's avatar Harsh Shah Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Fix context refcount underflow" into dev/msm-4.14-camx

parents deeaa94e a2708487
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ int cam_context_shutdown(struct cam_context *ctx)
	}

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

+1 −0
Original line number Diff line number Diff line
@@ -490,6 +490,7 @@ int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx,
	release.ctxt_to_hw_map = ctx->ctxt_to_hw_map;
	ctx->hw_mgr_intf->hw_release(ctx->hw_mgr_intf->hw_mgr_priv, &release);
	ctx->ctxt_to_hw_map = NULL;
	ctx->dev_hdl = -1;
end:
	return rc;
}
+5 −2
Original line number Diff line number Diff line
@@ -413,13 +413,16 @@ int cam_node_deinit(struct cam_node *node)
int cam_node_shutdown(struct cam_node *node)
{
	int i = 0;
	int rc = 0;

	if (!node)
		return -EINVAL;

	for (i = 0; i < node->ctx_size; i++) {
		if (node->ctx_list[i].dev_hdl >= 0) {
			cam_context_shutdown(&(node->ctx_list[i]));
		if (node->ctx_list[i].dev_hdl > 0) {
			rc = cam_context_shutdown(&(node->ctx_list[i]));
			if (rc)
				continue;
			cam_context_putref(&(node->ctx_list[i]));
		}
	}