summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/ivtv/ivtv-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-11-11 12:27:42 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-11-16 10:38:04 +0100
commitd55ebd07b6c21a1c7e3e74f1b73b3b033cece2b5 (patch)
tree9f8eecb71495c7150c64e0a1a213de9fb1f714f7 /drivers/media/pci/ivtv/ivtv-driver.c
parent[media] Revert "[media] ivtv: avoid going past input/audio array" (diff)
downloadlinux-d55ebd07b6c21a1c7e3e74f1b73b3b033cece2b5.tar.xz
linux-d55ebd07b6c21a1c7e3e74f1b73b3b033cece2b5.zip
[media] ivtv: avoid going past input/audio array
As reported by smatch: drivers/media/pci/ivtv/ivtv-driver.c:832 ivtv_init_struct2() error: buffer overflow 'itv->card->video_inputs' 6 <= 6 Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci/ivtv/ivtv-driver.c')
-rw-r--r--drivers/media/pci/ivtv/ivtv-driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index c2e60b4f292d..2bb10cd9ecfd 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -826,7 +826,7 @@ static void ivtv_init_struct2(struct ivtv *itv)
IVTV_CARD_INPUT_VID_TUNER)
break;
}
- if (i == itv->nof_inputs)
+ if (i >= itv->nof_inputs)
i = 0;
itv->active_input = i;
itv->audio_input = itv->card->video_inputs[i].audio_index;