提交 b72845ee 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

media: davinci/vpbe: array underflow in vpbe_enum_outputs()

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: 66715cdc ("[media] davinci vpbe: VPBE display driver")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: N"Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 823a633e
......@@ -104,7 +104,7 @@ static int vpbe_enum_outputs(struct vpbe_device *vpbe_dev,
struct v4l2_output *output)
{
struct vpbe_config *cfg = vpbe_dev->cfg;
int temp_index = output->index;
unsigned int temp_index = output->index;
if (temp_index >= cfg->num_outputs)
return -EINVAL;
......
......@@ -92,7 +92,7 @@ struct vpbe_config {
struct encoder_config_info *ext_encoders;
/* amplifier information goes here */
struct amp_config_info *amp;
int num_outputs;
unsigned int num_outputs;
/* Order is venc outputs followed by LCD and then external encoders */
struct vpbe_output *outputs;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册