diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-11-27 02:33:25 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:17:53 -0500 |
commit | a3a9e287daa1f299e318161b790b1c5902b1d869 (patch) | |
tree | 1f20db447f28a6346ce9d9fe2ebb0ff3eac65f96 /drivers/media/radio/radio-mr800.c | |
parent | cda4303f555316930a219cd7c03a1925526145f0 (diff) |
V4L/DVB (13547): radio: add trivial checks on the tuner and type args.
Many radio drivers did not check the tuner and type field correctly
for g/s_frequency. These checks have now been added.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-mr800.c')
-rw-r--r-- | drivers/media/radio/radio-mr800.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 949f60513d9e..02a9cefc9a00 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, | |||
374 | { | 374 | { |
375 | struct amradio_device *radio = file->private_data; | 375 | struct amradio_device *radio = file->private_data; |
376 | 376 | ||
377 | if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) | ||
378 | return -EINVAL; | ||
377 | return amradio_setfreq(radio, f->frequency); | 379 | return amradio_setfreq(radio, f->frequency); |
378 | } | 380 | } |
379 | 381 | ||
@@ -383,6 +385,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, | |||
383 | { | 385 | { |
384 | struct amradio_device *radio = file->private_data; | 386 | struct amradio_device *radio = file->private_data; |
385 | 387 | ||
388 | if (f->tuner != 0) | ||
389 | return -EINVAL; | ||
386 | f->type = V4L2_TUNER_RADIO; | 390 | f->type = V4L2_TUNER_RADIO; |
387 | f->frequency = radio->curfreq; | 391 | f->frequency = radio->curfreq; |
388 | 392 | ||