diff --git a/drivers/cam_cdm/cam_cdm_hw_core.c b/drivers/cam_cdm/cam_cdm_hw_core.c index 857e7cc1b82d..3703ba2e51f0 100644 --- a/drivers/cam_cdm/cam_cdm_hw_core.c +++ b/drivers/cam_cdm/cam_cdm_hw_core.c @@ -856,6 +856,7 @@ static int cam_hw_cdm_arb_submit_bl(struct cam_hw_info *cdm_hw, "CDM hw bl write failed tag=%d", core->bl_fifo[fifo_idx].bl_tag - 1); + cam_mem_put_cpu_buf(cdm_cmd->cmd[i].bl_addr.mem_handle); list_del_init(&node->entry); kfree(node); return -EIO; @@ -867,11 +868,12 @@ static int cam_hw_cdm_arb_submit_bl(struct cam_hw_info *cdm_hw, "CDM hw commit failed tag=%d", core->bl_fifo[fifo_idx].bl_tag - 1); + cam_mem_put_cpu_buf(cdm_cmd->cmd[i].bl_addr.mem_handle); list_del_init(&node->entry); kfree(node); return -EIO; } - + cam_mem_put_cpu_buf(cdm_cmd->cmd[i].bl_addr.mem_handle); return 0; } diff --git a/drivers/cam_core/cam_context_utils.c b/drivers/cam_core/cam_context_utils.c index 523d742f024d..ab3d0ad5c5f7 100644 --- a/drivers/cam_core/cam_context_utils.c +++ b/drivers/cam_core/cam_context_utils.c @@ -379,6 +379,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, if ((len < sizeof(struct cam_packet)) || (cmd->offset >= (len - sizeof(struct cam_packet)))) { CAM_ERR(CAM_CTXT, "Not enough buf"); + cam_mem_put_cpu_buf((int32_t) cmd->packet_handle); return -EINVAL; } @@ -497,7 +498,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, req->in_map_entries[j].sync_id, rc); } } - + cam_mem_put_cpu_buf((int32_t) cmd->packet_handle); return rc; put_ref: for (--i; i >= 0; i--) { @@ -511,6 +512,7 @@ free_req: req->ctx = NULL; spin_unlock(&ctx->lock); + cam_mem_put_cpu_buf((int32_t) cmd->packet_handle); return rc; } diff --git a/drivers/cam_isp/cam_isp_context.c b/drivers/cam_isp/cam_isp_context.c index 6b781819767c..f9d0c147e78f 100644 --- a/drivers/cam_isp/cam_isp_context.c +++ b/drivers/cam_isp/cam_isp_context.c @@ -4936,6 +4936,7 @@ static int __cam_isp_ctx_config_dev_in_top_state( __cam_isp_ctx_schedule_apply_req_offline(ctx_isp); } + cam_mem_put_cpu_buf((int32_t) cmd->packet_handle); return rc; put_ref: @@ -4949,6 +4950,7 @@ free_req: list_add_tail(&req->list, &ctx->free_req_list); spin_unlock_bh(&ctx->lock); + cam_mem_put_cpu_buf((int32_t) cmd->packet_handle); return rc; } diff --git a/drivers/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c b/drivers/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c index d0d5c827159a..fa2bdf8b83d3 100644 --- a/drivers/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c +++ b/drivers/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c @@ -129,6 +129,7 @@ static int cam_isp_update_dual_config( if (dual_config->num_ports > size_isp_out) { CAM_ERR(CAM_ISP, "num_ports %d more than max_vfe_out_res %d", dual_config->num_ports, size_isp_out); + cam_mem_put_cpu_buf(cmd_desc->mem_handle); return -EINVAL; } diff --git a/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c b/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c index f9c4d94f679b..0f41ab1b152c 100644 --- a/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c +++ b/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c @@ -315,6 +315,7 @@ static int cam_jpeg_mgr_process_irq(void *priv, void *data) CAM_ERR(CAM_JPEG, "Invalid offset: %u cmd buf len: %zu", p_cfg_req->hw_cfg_args.hw_update_entries[ CAM_JPEG_PARAM].offset, cmd_buf_len); + cam_mem_put_cpu_buf(mem_hdl); return -EINVAL; } @@ -341,6 +342,7 @@ static int cam_jpeg_mgr_process_irq(void *priv, void *data) mutex_lock(&g_jpeg_hw_mgr.hw_mgr_mutex); list_add_tail(&p_cfg_req->list, &hw_mgr->free_req_list); mutex_unlock(&g_jpeg_hw_mgr.hw_mgr_mutex); + cam_mem_put_cpu_buf(mem_hdl); return rc; }