Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85aae7fa authored by Mukund Madhusudan Atre's avatar Mukund Madhusudan Atre
Browse files

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: default avatarMukund Madhusudan Atre <matre@codeaurora.org>
parent 3a756cef
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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];
+1 −1
Original line number Diff line number Diff line
@@ -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;
};