linux/drivers/media/cec
Dan Carpenter 3b5af3171e media: cec: silence shift wrapping warning in __cec_s_log_addrs()
The log_addrs->log_addr_type[i] value is a u8 which is controlled by
the user and comes from the ioctl.  If it's over 31 then that results in
undefined behavior (shift wrapping) and that leads to a Smatch static
checker warning.  We already cap the value later so we can silence the
warning just by re-ordering the existing checks.

I think the UBSan checker will also catch this bug at runtime and
generate a warning.  But otherwise the bug is harmless.

Fixes: 9881fe0ca1 ("[media] cec: add HDMI CEC framework (adapter)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05 17:27:03 +02:00
..
core media: cec: silence shift wrapping warning in __cec_s_log_addrs() 2020-05-05 17:27:03 +02:00
platform media: cec-gpio: handle gpiod_get_value errors correctly 2020-04-29 12:04:38 +02:00
usb media: cec/usb: depends on USB_SUPPORT and TTY 2020-04-17 09:04:55 +02:00
Kconfig media: move CEC USB drivers to a separate directory 2020-04-15 12:06:40 +02:00
Makefile media: move CEC USB drivers to a separate directory 2020-04-15 12:06:40 +02:00