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

Commit 25729102 authored by Kui Wang's avatar Kui Wang Committed by Venkat Chinta
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 f74ff626
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -472,8 +472,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);
@@ -481,7 +480,9 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
	}

	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))