msm: camera: fd: Add balanced dynamic allocation for free in init

The work data passed as payload to workq is statically allocated,
which has kfree call during destroy, this fails during component
unbind. Change allocation of work data to dynamic in fd hw manager.

CRs-Fixed: 2584631
Change-Id: I0cd2a152d39793ce620e9a9fc2950ee91cefe6bf
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
This commit is contained in:
Mukund Madhusudan Atre 2020-02-26 16:51:56 -08:00
commit 85aae7fa2c
2 changed files with 4 additions and 1 deletions

View file

@ -2053,6 +2053,9 @@ int cam_fd_hw_mgr_init(struct device_node *of_node,
goto detach_smmu;
}
g_fd_hw_mgr.work_data = kcalloc(CAM_FD_WORKQ_NUM_TASK,
sizeof(struct cam_fd_mgr_work_data), GFP_KERNEL);
for (i = 0; i < CAM_FD_WORKQ_NUM_TASK; i++)
g_fd_hw_mgr.work->task.pool[i].payload =
&g_fd_hw_mgr.work_data[i];

View file

@ -180,7 +180,7 @@ struct cam_fd_hw_mgr {
struct cam_fd_hw_mgr_ctx ctx_pool[CAM_CTX_MAX];
struct cam_fd_mgr_frame_request frame_req[CAM_CTX_REQ_MAX];
struct cam_req_mgr_core_workq *work;
struct cam_fd_mgr_work_data work_data[CAM_FD_WORKQ_NUM_TASK];
struct cam_fd_mgr_work_data *work_data;
struct cam_fd_query_cap_cmd fd_caps;
};