msm: camera: reqmgr: Fix trigger count out of bound issue

Since the CAM_TRIGGER_MAX_POINTS equal to CAM_TRIGGER_POINT_EOF,
so we need to use CAM_TRIGGER_MAX_POINTS + 1 to define the
trigger count.

CRs-Fixed: 3007296
Change-Id: Ia0cefd8381417a4b7ecd8636796bf25df705101d
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
Bu işleme şunda yer alıyor:
Depeng Shao
2021-08-04 15:16:15 +08:00
ebeveyn 9631f05e75
işleme 75a0aff96f
2 değiştirilmiş dosya ile 14 ekleme ve 13 silme

Dosyayı Görüntüle

@@ -53,10 +53,10 @@ void cam_req_mgr_core_link_reset(struct cam_req_mgr_core_link *link)
link->sync_data.initial_sync_req = -1;
link->sync_data.modified_init_sync_req = -1;
link->dual_trigger = false;
link->trigger_cnt[0][0] = 0;
link->trigger_cnt[0][1] = 0;
link->trigger_cnt[1][0] = 0;
link->trigger_cnt[1][1] = 0;
link->trigger_cnt[0][CAM_TRIGGER_POINT_SOF] = 0;
link->trigger_cnt[0][CAM_TRIGGER_POINT_EOF] = 0;
link->trigger_cnt[1][CAM_TRIGGER_POINT_SOF] = 0;
link->trigger_cnt[1][CAM_TRIGGER_POINT_EOF] = 0;
link->in_msync_mode = false;
link->retry_cnt = 0;
link->is_shutdown = false;
@@ -662,10 +662,10 @@ static void __cam_req_mgr_flush_req_slot(
in_q->wr_idx = 0;
in_q->rd_idx = 0;
link->sync_data.sync_frame_id = 0;
link->trigger_cnt[0][0] = 0;
link->trigger_cnt[0][1] = 0;
link->trigger_cnt[1][0] = 0;
link->trigger_cnt[1][1] = 0;
link->trigger_cnt[0][CAM_TRIGGER_POINT_SOF] = 0;
link->trigger_cnt[0][CAM_TRIGGER_POINT_EOF] = 0;
link->trigger_cnt[1][CAM_TRIGGER_POINT_SOF] = 0;
link->trigger_cnt[1][CAM_TRIGGER_POINT_EOF] = 0;
}
/**
@@ -4726,10 +4726,10 @@ int cam_req_mgr_link_v2(struct cam_req_mgr_ver_info *link_info)
goto setup_failed;
}
link->trigger_cnt[0][0] = 0;
link->trigger_cnt[0][1] = 0;
link->trigger_cnt[1][0] = 0;
link->trigger_cnt[1][1] = 0;
link->trigger_cnt[0][CAM_TRIGGER_POINT_SOF] = 0;
link->trigger_cnt[0][CAM_TRIGGER_POINT_EOF] = 0;
link->trigger_cnt[1][CAM_TRIGGER_POINT_SOF] = 0;
link->trigger_cnt[1][CAM_TRIGGER_POINT_EOF] = 0;
mutex_unlock(&link->lock);
mutex_unlock(&g_crm_core_dev->crm_lock);

Dosyayı Görüntüle

@@ -450,7 +450,8 @@ struct cam_req_mgr_core_link {
uint32_t retry_cnt;
bool is_shutdown;
bool dual_trigger;
uint32_t trigger_cnt[CAM_REQ_MGR_MAX_TRIGGERS][CAM_TRIGGER_MAX_POINTS];
uint32_t trigger_cnt[CAM_REQ_MGR_MAX_TRIGGERS]
[CAM_TRIGGER_MAX_POINTS + 1];
atomic_t eof_event_cnt;
bool skip_init_frame;
bool wq_congestion;