Patch "media: amphion: ensure the bitops don't cross boundaries" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: amphion: ensure the bitops don't cross boundaries

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-amphion-ensure-the-bitops-don-t-cross-boundari.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e5f85a602b9957906753c4408521cf93e390eea4
Author: Ming Qian <ming.qian@xxxxxxx>
Date:   Tue Jul 18 17:50:13 2023 +0800

    media: amphion: ensure the bitops don't cross boundaries
    
    [ Upstream commit 5bd28eae48589694ff4e5badb03bf75dae695b3f ]
    
    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 <nicolas.dufresne@xxxxxxxxxxxxx>
    Signed-off-by: Ming Qian <ming.qian@xxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/platform/amphion/vpu_core.c b/drivers/media/platform/amphion/vpu_core.c
index 82bf8b3be66a2..bfdebf2449a5c 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);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux