This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] em28xx: fix incorrect s_ctrl error code and wrong call to 
res_free
Author:  Hans Verkuil <hverk...@xs4all.nl>
Date:    Wed Dec 29 14:28:13 2010 -0300

Calling subdevs to handle s_ctrl returned a non-zero return code even if
everything went fine.

Calling STREAMOFF if no STREAMON happened earlier would hit a BUG_ON
in res_free.

Signed-off-by: Hans Verkuil <hverk...@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>

 drivers/media/video/em28xx/em28xx-video.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=878251fd25f7d88788636cccc7e916249fc8ba76

diff --git a/drivers/media/video/em28xx/em28xx-video.c 
b/drivers/media/video/em28xx/em28xx-video.c
index 7be9bba..37b48a2 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1434,7 +1434,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
 
        /* It isn't an AC97 control. Sends it to the v4l2 dev interface */
        if (rc == 1) {
-               v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl);
+               rc = v4l2_device_call_until_err(&dev->v4l2_dev, 0, core, 
s_ctrl, ctrl);
 
                /*
                 * In the case of non-AC97 volume controls, we still need
@@ -1708,11 +1708,15 @@ static int vidioc_streamoff(struct file *file, void 
*priv,
                        fh, type, fh->resources, dev->resources);
 
        if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
-               videobuf_streamoff(&fh->vb_vidq);
-               res_free(fh, EM28XX_RESOURCE_VIDEO);
+               if (res_check(fh, EM28XX_RESOURCE_VIDEO)) {
+                       videobuf_streamoff(&fh->vb_vidq);
+                       res_free(fh, EM28XX_RESOURCE_VIDEO);
+               }
        } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
-               videobuf_streamoff(&fh->vb_vbiq);
-               res_free(fh, EM28XX_RESOURCE_VBI);
+               if (res_check(fh, EM28XX_RESOURCE_VBI)) {
+                       videobuf_streamoff(&fh->vb_vbiq);
+                       res_free(fh, EM28XX_RESOURCE_VBI);
+               }
        }
 
        return 0;

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to