summaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-async.h
diff options
context:
space:
mode:
authorNĂ­colas F. R. A. Prado <nfraprado@collabora.com>2023-07-26 12:57:39 -0400
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-07-27 11:24:26 +0200
commitdd61c2a380037166517214957790a1486ae5d348 (patch)
treeba0028faabacde28d3cc517090917912bdb34525 /include/media/v4l2-async.h
parent7baeedbe2bc6fac7d54f73e44605f6b7b40158ab (diff)
downloadlinux-stable-dd61c2a380037166517214957790a1486ae5d348.tar.gz
linux-stable-dd61c2a380037166517214957790a1486ae5d348.tar.bz2
linux-stable-dd61c2a380037166517214957790a1486ae5d348.zip
media: mediatek: vcodec: Consider vdecsys presence in reg range check
Commit fe8a33978383 ("media: mediatek: vcodec: Read HW active status from syscon") allowed the driver to read the VDEC_SYS io space from a syscon instead of from the reg property when reg-names are supplied. However as part of that change, a smatch warning was introduced: drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c:142 mtk_vcodec_get_reg_bases() error: buffer overflow 'mtk_dec_reg_names' 11 <= 11 With a correct Devicetree, that is, one that follows the dt-binding, it wouldn't be possible to trigger such a buffer overflow. Even so, update the range validation of the reg property, so that the smatch warning is fixed and if an incorrect Devicetree is ever supplied the code errors out instead of causing memory corruption. Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Closes: https://lore.kernel.org/all/b5fd2dff-14a5-3ad8-9698-d1a50f4516fa@xs4all.nl Fixes: fe8a33978383 ("media: mediatek: vcodec: Read HW active status from syscon") Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'include/media/v4l2-async.h')
0 files changed, 0 insertions, 0 deletions