diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 35edee009ba8b859378fcdf9e11a1f8fab1835b2..5bf4985daede6a49e9b35adcb3b3256b51a14924 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c @@ -268,6 +268,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct rtrack *rt = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; rt_setfreq(rt, f->frequency); return 0; } @@ -277,6 +279,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct rtrack *rt = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = rt->curfreq; return 0; diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index 8daf809eb01aa8c8fa218e177460fd190defc1ce..c22311393624d26ebfbe0d4db8776a7c536b3a70 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c @@ -254,6 +254,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct aztech *az = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; az_setfreq(az, f->frequency); return 0; } @@ -263,6 +265,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct aztech *az = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = az->curfreq; return 0; diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c index c6cf1166186824b1c062350617c14c7edef0ed01..000f4d34087ce2352fbd9c4ae8b47846f49aaa82 100644 --- a/drivers/media/radio/radio-gemtek-pci.c +++ b/drivers/media/radio/radio-gemtek-pci.c @@ -240,6 +240,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct gemtek_pci *card = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; if (f->frequency < GEMTEK_PCI_RANGE_LOW || f->frequency > GEMTEK_PCI_RANGE_HIGH) return -EINVAL; @@ -253,6 +255,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct gemtek_pci *card = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = card->current_frequency; return 0; diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c index 64d737c35acf18de14d9cc625ba7982ae3f3d641..f8213b7c8ddc2a6c97ac94e8c52846fe9606711a 100644 --- a/drivers/media/radio/radio-maestro.c +++ b/drivers/media/radio/radio-maestro.c @@ -200,6 +200,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct maestro *dev = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) return -EINVAL; mutex_lock(&dev->lock); @@ -213,6 +215,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct maestro *dev = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; mutex_lock(&dev->lock); f->frequency = BITS2FREQ(radio_bits_get(dev)); diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 3da51fe8fb937c46ab349a345ecea6a8cddcbfc7..44b4dbedb322a57108483494f4785b7b02252076 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -262,6 +262,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct maxiradio *dev = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) { dprintk(dev, 1, "radio freq (%d.%02d MHz) out of range (%d-%d)\n", f->frequency / 16000, @@ -285,6 +287,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct maxiradio *dev = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = dev->freq; diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 949f60513d9e08862ff05f6cc925cf46c7092306..02a9cefc9a00d6b6e12dc595b0aa5d8c1baee17e 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -374,6 +374,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct amradio_device *radio = file->private_data; + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; return amradio_setfreq(radio, f->frequency); } @@ -383,6 +385,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct amradio_device *radio = file->private_data; + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = radio->curfreq; diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index 9cb193fa6e335c367920e2079b67716e17378b6c..a79296aac9a9636e408a27a7da9a42cf9c4e21e3 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c @@ -167,6 +167,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct rtrack2 *rt = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; rt_setfreq(rt, f->frequency); return 0; } @@ -176,6 +178,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct rtrack2 *rt = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = rt->curfreq; return 0; diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index 49c4aab95daba17a6298a007af3ac502bb7a0282..93990b7899ecdddf2e40ab63bf0a8df6214af31d 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c @@ -168,6 +168,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct fmi *fmi = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; if (f->frequency < RSF16_MINFREQ || f->frequency > RSF16_MAXFREQ) return -EINVAL; @@ -182,6 +184,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct fmi *fmi = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = fmi->curfreq; return 0; diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index a11414f648d4f9279431b98d103450d4c8926bfd..52c7bbb32b8b7ea10312ff58716c47f1ed472bd2 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c @@ -251,6 +251,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct fmr2 *fmr2 = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; if (f->frequency < RSF16_MINFREQ || f->frequency > RSF16_MAXFREQ) return -EINVAL; @@ -272,6 +274,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct fmr2 *fmr2 = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = fmr2->curfreq; return 0; diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c index 3cd76dddb6aad7ca6fb0eaff71a66385850165f6..730ffd9cdd3e633f444d4a31d06887ef9fd3a1f4 100644 --- a/drivers/media/radio/radio-tea5764.c +++ b/drivers/media/radio/radio-tea5764.c @@ -349,7 +349,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct tea5764_device *radio = video_drvdata(file); - if (f->tuner != 0) + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) return -EINVAL; if (f->frequency == 0) { /* We special case this as a power down control. */ @@ -370,6 +370,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, struct tea5764_device *radio = video_drvdata(file); struct tea5764_regs *r = &radio->regs; + if (f->tuner != 0) + return -EINVAL; tea5764_i2c_read(radio); memset(f, 0, sizeof(f)); f->type = V4L2_TUNER_RADIO; diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index 699db9acaaf79e18df99e0baa9afc708caef9e84..fc1c860fd43844c188d4e42cc845a5f40b4ae957 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c @@ -240,6 +240,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct terratec *tt = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; tt_setfreq(tt, f->frequency); return 0; } @@ -249,6 +251,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct terratec *tt = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = tt->curfreq; return 0; diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index 6f9ecc359356c1cc20f93210d5558f072ca66c76..9d6dcf8af5b01de328436a0955ae190fe651aa72 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c @@ -239,6 +239,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct trust *tr = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; tr_setfreq(tr, f->frequency); return 0; } @@ -248,6 +250,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct trust *tr = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = tr->curfreq; return 0; diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c index 3a98f139949565e23c84ce6ba7cd715b79d36e39..03439282dfce1f18d98d8e6dd12ac8fe8e65adb9 100644 --- a/drivers/media/radio/radio-typhoon.c +++ b/drivers/media/radio/radio-typhoon.c @@ -207,6 +207,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct typhoon *dev = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = dev->curfreq; return 0; @@ -217,6 +219,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct typhoon *dev = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; dev->curfreq = f->frequency; typhoon_setfreq(dev, dev->curfreq); return 0; diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index 80e98b6422fe76d4d48847f23e0a73199a4472dc..f31eab99c943ba9cdc722e7b3163ed91f079d8a1 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c @@ -266,6 +266,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, { struct zoltrix *zol = video_drvdata(file); + if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) + return -EINVAL; if (zol_setfreq(zol, f->frequency) != 0) return -EINVAL; return 0; @@ -276,6 +278,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, { struct zoltrix *zol = video_drvdata(file); + if (f->tuner != 0) + return -EINVAL; f->type = V4L2_TUNER_RADIO; f->frequency = zol->curfreq; return 0;