As reported by smatch:
drivers/media/pci/ivtv/ivtv-driver.c:832 ivtv_init_struct2() error:
buffer overflow 'itv->card->video_inputs' 6 <= 6
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 <[email protected]>
---
v2: Added a missing new line after the patch subject.
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c
b/drivers/media/pci/ivtv/ivtv-driver.c
index 21501c560610..374033a5bdaf 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;
--
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html