Commit a595c1ce authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

[media] au0828: fix case where STREAMOFF being called on stopped stream causes BUG()

We weren't checking whether the resource was in use before calling
res_free(), so applications which called STREAMOFF on a v4l2 device that
wasn't already streaming would cause a BUG() to be hit (MythTV).
Reported-by: default avatarLarry Finger <larry.finger@lwfinger.net>
Reported-by: default avatarJay Harbeston <jharbestonus@gmail.com>
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4a03dafc
...@@ -1702,15 +1702,19 @@ static int vidioc_streamoff(struct file *file, void *priv, ...@@ -1702,15 +1702,19 @@ static int vidioc_streamoff(struct file *file, void *priv,
(AUVI_INPUT(i).audio_setup)(dev, 0); (AUVI_INPUT(i).audio_setup)(dev, 0);
} }
if (res_check(fh, AU0828_RESOURCE_VIDEO)) {
videobuf_streamoff(&fh->vb_vidq); videobuf_streamoff(&fh->vb_vidq);
res_free(fh, AU0828_RESOURCE_VIDEO); res_free(fh, AU0828_RESOURCE_VIDEO);
}
} else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
dev->vbi_timeout_running = 0; dev->vbi_timeout_running = 0;
del_timer_sync(&dev->vbi_timeout); del_timer_sync(&dev->vbi_timeout);
if (res_check(fh, AU0828_RESOURCE_VBI)) {
videobuf_streamoff(&fh->vb_vbiq); videobuf_streamoff(&fh->vb_vbiq);
res_free(fh, AU0828_RESOURCE_VBI); res_free(fh, AU0828_RESOURCE_VBI);
} }
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment