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