mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
media: cx18: fix incorrect input counting
Counting the number of video and audio inputs was wrong if the number of inputs equalled CX18_CARD_MAX_VIDEO_INPUTS or CX18_CARD_MAX_AUDIO_INPUTS. This was a copy-and-paste from the ivtv driver. That driver has been fixed quite a long time ago, but we missed that this driver had the same bug. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
643e835014
commit
274cb00985
1 changed files with 2 additions and 2 deletions
|
@ -771,11 +771,11 @@ static void cx18_init_struct2(struct cx18 *cx)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CX18_CARD_MAX_VIDEO_INPUTS - 1; i++)
|
||||
for (i = 0; i < CX18_CARD_MAX_VIDEO_INPUTS; i++)
|
||||
if (cx->card->video_inputs[i].video_type == 0)
|
||||
break;
|
||||
cx->nof_inputs = i;
|
||||
for (i = 0; i < CX18_CARD_MAX_AUDIO_INPUTS - 1; i++)
|
||||
for (i = 0; i < CX18_CARD_MAX_AUDIO_INPUTS; i++)
|
||||
if (cx->card->audio_inputs[i].audio_type == 0)
|
||||
break;
|
||||
cx->nof_audio_inputs = i;
|
||||
|
|
Loading…
Reference in a new issue