From 1414b82cc253424735639f2f24a7e87cd69375bb Mon Sep 17 00:00:00 2001 From: Gaurav Jindal Date: Thu, 9 Apr 2020 14:42:44 +0530 Subject: [PATCH] msm: camera: core: Delete request from pending list in case of error While preparing hw for request, there is a possiblity of receiving invalid sync object. In this case, we need to return error. By this time, the request is already in pending list. While returning error, request is moved back to free list. But deleting from the pending list was missed. This commit deleted the request from the pending list if the sync object received is invalid. CRs-Fixed: 2660625 Change-Id: Id619452889476b0c2811c8560361205b0d89bcb9 Signed-off-by: Gaurav Jindal --- drivers/cam_core/cam_context_utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cam_core/cam_context_utils.c b/drivers/cam_core/cam_context_utils.c index dfdcbfac90..c990db2c11 100644 --- a/drivers/cam_core/cam_context_utils.c +++ b/drivers/cam_core/cam_context_utils.c @@ -530,6 +530,9 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, rc = cam_sync_check_valid( req->in_map_entries[j].sync_id); if (rc) { + spin_lock(&ctx->lock); + list_del_init(&req->list); + spin_unlock(&ctx->lock); CAM_ERR(CAM_CTXT, "invalid in map sync object %d", req->in_map_entries[j].sync_id);