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

Commit eb7b2f9c authored by Kui Wang's avatar Kui Wang
Browse files

msm: camera: core: release ref after config failed



when configure device failed, it should release
all context reference added. Otherwise it will
result in context leak

Change-Id: I686a1accb3d4efa84de93fbe6d1f434d2fb1494e
Signed-off-by: default avatarKui Wang <kuiw@codeaurora.org>
parent 5124a62b
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -480,8 +480,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
						ctx->dev_name, ctx->ctx_id,
						req->request_id);

				cam_context_putref(ctx);
				goto put_ref;
				goto put_ctx_ref;
			}
			CAM_DBG(CAM_CTXT, "register in fence cb: %d ret = %d",
				req->in_map_entries[j].sync_id, rc);
@@ -493,7 +492,9 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
			ctx->dev_name, ctx->ctx_id);

	return rc;

put_ctx_ref:
	for (j; j >= 0; j--)
		cam_context_putref(ctx);
put_ref:
	for (--i; i >= 0; i--) {
		if (cam_sync_put_obj_ref(req->out_map_entries[i].sync_id))