]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
media: davinci/vpbe: array underflow in vpbe_enum_outputs()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 24 Apr 2019 09:46:27 +0000 (05:46 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit8feab26cd216bc6258ae4b208fe20bc7f9f7871a
treed18d6656e4a0833feabc15271ce509af879e5522
parented8d35765bfca31800c29f530a9f437965de28ef
media: davinci/vpbe: array underflow in vpbe_enum_outputs()

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit b72845ee5577b227131b1fef23f9d9a296621d7b ]

In vpbe_enum_outputs() we check if (temp_index >= cfg->num_outputs) but
the problem is that "temp_index" can be negative.  This patch changes
the types to unsigned to address this array underflow bug.

Fixes: 66715cdc3224 ("[media] davinci vpbe: VPBE display driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/media/platform/davinci/vpbe.c
include/media/davinci/vpbe.h