From 8a50e9a266bb50a040473fe27c579175b8251b5f Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 21 May 2007 13:56:17 -0400 Subject: cx88-blackbird: fix vidioc_g_tuner never ending list of tuners From: Jelle Foks 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: Jelle Foks Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx88/cx88-blackbird.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index 9103d9567..97e207d56 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -1057,6 +1057,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; -- cgit v1.2.3