video: rockchip: mpp: vepu2: prevent core_id out of bounds

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib03e3be97f0902ae17f87ef3b97f1788c807be1b
This commit is contained in:
Yandong Lin
2023-03-29 09:54:34 +08:00
committed by Tao Huang
parent 078b5e4595
commit eeb364e60d

View File

@@ -336,7 +336,7 @@ static void *vepu_prepare(struct mpp_dev *mpp, struct mpp_task *mpp_task)
}
core_id = find_first_bit(&ccu->core_idle, ccu->core_num);
core_id = array_index_nospec(core_id, MPP_MAX_CORE_NUM);
if (core_id >= core_id_max + 1 || !queue->cores[core_id]) {
mpp_task = NULL;
mpp_dbg_core("core %d all busy %lx\n", core_id, ccu->core_idle);