diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2012-08-06 22:47:03 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-28 10:02:12 -0700 |
commit | 6613dbb3a2126a2ef4c5763e496afb7975eaa3de (patch) | |
tree | 7ea741fb6205bf57bb9111835eaa7a60c30b2939 | |
parent | a322f9a0799883553a0898c7062a944ff64a3056 (diff) | |
download | kernel_samsung_tuna-6613dbb3a2126a2ef4c5763e496afb7975eaa3de.zip kernel_samsung_tuna-6613dbb3a2126a2ef4c5763e496afb7975eaa3de.tar.gz kernel_samsung_tuna-6613dbb3a2126a2ef4c5763e496afb7975eaa3de.tar.bz2 |
media: au0828: fix case where STREAMOFF being called on stopped stream causes BUG()
commit a595c1ce4c9d572cf53513570b9f1a263d7867f2 upstream.
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: Larry Finger <larry.finger@lwfinger.net>
Reported-by: Jay Harbeston <jharbestonus@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/au0828/au0828-video.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index c03eb29..9945aaf 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c @@ -1697,14 +1697,18 @@ static int vidioc_streamoff(struct file *file, void *priv, (AUVI_INPUT(i).audio_setup)(dev, 0); } - videobuf_streamoff(&fh->vb_vidq); - res_free(fh, AU0828_RESOURCE_VIDEO); + if (res_check(fh, AU0828_RESOURCE_VIDEO)) { + videobuf_streamoff(&fh->vb_vidq); + res_free(fh, AU0828_RESOURCE_VIDEO); + } } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { dev->vbi_timeout_running = 0; del_timer_sync(&dev->vbi_timeout); - videobuf_streamoff(&fh->vb_vbiq); - res_free(fh, AU0828_RESOURCE_VBI); + if (res_check(fh, AU0828_RESOURCE_VBI)) { + videobuf_streamoff(&fh->vb_vbiq); + res_free(fh, AU0828_RESOURCE_VBI); + } } return 0; |