Преглед на файлове

msm: camera: jpeg: Release the failed request for jpeg

Fix the incorrect implementation which keeps the failed
thumbnail requests in the active request list and do not
free up.

CRs-Fixed: 2999106
Change-Id: I8f34d8b24aa1e0e3afb1452cffbf5a4113e0dc0e
Signed-off-by: Jigar Agrawal <[email protected]>
Jigar Agrawal преди 3 години
родител
ревизия
7aaba7949c
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c

+ 10 - 0
drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c

@@ -344,6 +344,7 @@ static int cam_jpeg_mgr_bottom_half_irq(void *priv, void *data)
 	struct cam_jpeg_process_frame_work_data_t               *wq_task_data;
 	struct cam_jpeg_request_data                            *jpeg_req;
 	struct cam_req_mgr_message                               v4l2_msg = {0};
+	struct cam_ctx_request                                  *req;
 
 	if (!data || !priv) {
 		CAM_ERR(CAM_JPEG, "Invalid data");
@@ -430,6 +431,15 @@ static int cam_jpeg_mgr_bottom_half_irq(void *priv, void *data)
 						p_cfg_req->hw_cfg_args.out_map_entries[i].sync_id);
 				}
 
+				spin_lock(&cam_ctx->lock);
+				if (!list_empty(&cam_ctx->active_req_list)) {
+					req = list_first_entry(&cam_ctx->active_req_list,
+						struct cam_ctx_request, list);
+					list_del_init(&req->list);
+					list_add_tail(&req->list, &cam_ctx->free_req_list);
+				}
+				spin_unlock(&cam_ctx->lock);
+
 				goto exit;
 			}
 		}