mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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: 66715cdc32 ("[media] davinci vpbe: VPBE display driver")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: "Lad, Prabhakar" <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
823a633eeb
commit
b72845ee55
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue