This is an automatic generated email to let you know that the following patch were queued:
Subject: media: amphion: ensure the bitops don't cross boundaries Author: Ming Qian <[email protected]> Date: Tue Jul 18 17:50:13 2023 +0800 the supported_instance_count determine the instance index range, it shouldn't exceed the bits number of instance_mask, otherwise the bitops of instance_mask may cross boundaries Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Reviewed-by: Nicolas Dufresne <[email protected]> Signed-off-by: Ming Qian <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> drivers/media/platform/amphion/vpu_core.c | 2 ++ 1 file changed, 2 insertions(+) --- diff --git a/drivers/media/platform/amphion/vpu_core.c b/drivers/media/platform/amphion/vpu_core.c index bb73b3815af2..1af6fc9460d4 100644 --- a/drivers/media/platform/amphion/vpu_core.c +++ b/drivers/media/platform/amphion/vpu_core.c @@ -88,6 +88,8 @@ static int vpu_core_boot_done(struct vpu_core *core) core->supported_instance_count = min(core->supported_instance_count, count); } + if (core->supported_instance_count >= BITS_PER_TYPE(core->instance_mask)) + core->supported_instance_count = BITS_PER_TYPE(core->instance_mask); core->fw_version = fw_version; vpu_core_set_state(core, VPU_CORE_ACTIVE); _______________________________________________ linuxtv-commits mailing list [email protected] https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
