Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f057131f authored by Jelle Foks's avatar Jelle Foks Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (5816): Cx88-blackbird: fix vidioc_g_tuner never ending list of tuners



v4l-info and other programs would loop indefinitely while querying the
tuners for cx88-blackbird cards.

The cause was that vidioc_g_tuner didn't return an error value for
qctrl->id != 0, making the application think there is a never ending
list of tuners...

This patch adds the same index check as done in vidioc_g_tuner() in
cx88-video.

Signed-off-by: default avatarJelle Foks <jelle@foks.8m.com>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 333408f2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1034,6 +1034,8 @@ static int vidioc_g_tuner (struct file *file, void *priv,

	if (unlikely(UNSET == core->tuner_type))
		return -EINVAL;
	if (0 != t->index)
		return -EINVAL;

	strcpy(t->name, "Television");
	t->type       = V4L2_TUNER_ANALOG_TV;