[media] cx18: avoid going past input/audio array
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 28 Apr 2015 12:50:36 +0000 (09:50 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 30 Apr 2015 16:15:31 +0000 (13:15 -0300)
commit2f9e682d05e27fef1a78b4089cfde818ea109d25
tree31a07b0109c3f06846fb1456928874fe4eccb8f1
parent81b7d14e32ddd2ae2709609bb2466f8f2482b8c9
[media] cx18: avoid going past input/audio array

As reported by smatch:
drivers/media/pci/cx18/cx18-driver.c:807 cx18_init_struct2() error: buffer overflow 'cx->card->video_inputs' 6 <= 6

That happens because nof_inputs and nof_audio_inputs can be initialized
as CX18_CARD_MAX_VIDEO_INPUTS, instead of CX18_CARD_MAX_VIDEO_INPUTS - 1.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/cx18/cx18-driver.c