V4L/DVB (13547): radio: add trivial checks on the tuner and type args.
[pandora-kernel.git] / drivers / media / radio / radio-aimslab.c
index 35edee0..5bf4985 100644 (file)
@@ -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;