소스 검색

msm: camera: ope: free unused memory in ope acquire

OPE driver allocate memory dynamically to store cdm
acquire and bw data in acquire time and don't use later.
These memories can be freed before returning from acquire.

CRs-Fixed: 2827058
Change-Id: Ibf87282862f2ae4655da3c69016bedb7f96bca1c
Signed-off-by: Alok Chauhan <[email protected]>
Alok Chauhan 4 년 전
부모
커밋
5a24b2b912
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.c

+ 4 - 0
drivers/cam_ope/ope_hw_mgr/cam_ope_hw_mgr.c

@@ -2734,6 +2734,10 @@ static int cam_ope_mgr_acquire_hw(void *hw_priv, void *hw_acquire_args)
 	ctx->ctxt_event_cb = args->event_cb;
 	ctx->ctxt_event_cb = args->event_cb;
 	cam_ope_ctx_clk_info_init(ctx);
 	cam_ope_ctx_clk_info_init(ctx);
 	ctx->ctx_state = OPE_CTX_STATE_ACQUIRED;
 	ctx->ctx_state = OPE_CTX_STATE_ACQUIRED;
+	kzfree(cdm_acquire);
+	cdm_acquire = NULL;
+	kzfree(bw_update);
+	bw_update = NULL;
 
 
 	mutex_unlock(&ctx->ctx_mutex);
 	mutex_unlock(&ctx->ctx_mutex);
 	mutex_unlock(&hw_mgr->hw_mgr_mutex);
 	mutex_unlock(&hw_mgr->hw_mgr_mutex);