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-maestro.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-maestro.c')
-rw-r--r-- | drivers/media/radio/radio-maestro.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c index 64d737c35acf..f8213b7c8ddc 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, | |||
200 | { | 200 | { |
201 | struct maestro *dev = video_drvdata(file); | 201 | struct maestro *dev = video_drvdata(file); |
202 | 202 | ||
203 | if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) | ||
204 | return -EINVAL; | ||
203 | if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) | 205 | if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) |
204 | return -EINVAL; | 206 | return -EINVAL; |
205 | mutex_lock(&dev->lock); | 207 | mutex_lock(&dev->lock); |
@@ -213,6 +215,8 @@ static int vidioc_g_frequency(struct file *file, void *priv, | |||
213 | { | 215 | { |
214 | struct maestro *dev = video_drvdata(file); | 216 | struct maestro *dev = video_drvdata(file); |
215 | 217 | ||
218 | if (f->tuner != 0) | ||
219 | return -EINVAL; | ||
216 | f->type = V4L2_TUNER_RADIO; | 220 | f->type = V4L2_TUNER_RADIO; |
217 | mutex_lock(&dev->lock); | 221 | mutex_lock(&dev->lock); |
218 | f->frequency = BITS2FREQ(radio_bits_get(dev)); | 222 | f->frequency = BITS2FREQ(radio_bits_get(dev)); |