]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 23 Sep 2019 20:12:02 +0000 (21:12 +0100)
commit993b03c917d72759a638b266ceb5652a1ee84dc7
treec2090be790654eac7c16bc87e106e074de85ccc7
parent00bd59675f5f81338c9edde2d71645aa286d1f84
media: davinci/vpbe: array underflow in vpbe_enum_outputs()

commit b72845ee5577b227131b1fef23f9d9a296621d7b upstream.

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: Ben Hutchings <ben@decadent.org.uk>
drivers/media/platform/davinci/vpbe.c
include/media/davinci/vpbe.h