Skip to content
Commit b98fd3cb authored by Colin Ian King's avatar Colin Ian King Committed by Mauro Carvalho Chehab
Browse files

media: vivid: fix potential integer overflow on left shift



There is a potential integer overflow when int 2 is left shifted
as this is evaluated using 32 bit arithmetic but is being used in
a context that expects an expression of type s64.  Fix this by
generating a mask using GENMASK to avoid a 32 bit overflow.

Addresses-Coverity: ("Unintentional integer overflow")

Fixes: 8a99e9fa ("media: vivid: add HDMI (dis)connect RX emulation")
Fixes: 79a792da ("media: vivid: add HDMI (dis)connect TX emulation")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent b61789f5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment