All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregor Jasny <jasny@vidsoft.de>
To: linux-kernel@vger.kernel.org,
	video4linux-list <video4linux-list@redhat.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	v4l-dvb-maintainer@linuxtv.org, "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH] Re: Regression: VIDIOCGMBUF ioctl hangs on bttv driver (2.6.24-rc6)
Date: Sun, 6 Jan 2008 15:15:54 +0100	[thread overview]
Message-ID: <20080106141548.GB18690@vidsoft.de> (raw)
In-Reply-To: <20080105223338.GA18690@vidsoft.de>

From: Gregor Jasny <gjasny@web.de>

Fix bttv VIDIOCGMBUF locking like done in commit
820eacd84cff23b76693f4be1e28feb672f4488f. 

Signed-off-by: Gregor Jasny <gjasny@web.de>
---
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index c02d92d..581a3c9 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3063,11 +3063,10 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
 		struct video_mbuf *mbuf = arg;
 		unsigned int i;
 
-		mutex_lock(&fh->cap.lock);
 		retval = videobuf_mmap_setup(&fh->cap,gbuffers,gbufsize,
 					     V4L2_MEMORY_MMAP);
 		if (retval < 0)
-			goto fh_unlock_and_return;
+			return retval;
 
 		gbuffers = retval;
 		memset(mbuf,0,sizeof(*mbuf));
@@ -3075,7 +3074,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
 		mbuf->size   = gbuffers * gbufsize;
 		for (i = 0; i < gbuffers; i++)
 			mbuf->offsets[i] = i * gbufsize;
-		mutex_unlock(&fh->cap.lock);
 		return 0;
 	}
 	case VIDIOCMCAPTURE:

  parent reply	other threads:[~2008-01-06 14:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-05 22:33 Regression: VIDIOCGMBUF ioctl hangs on bttv driver (2.6.24-rc6) Gregor Jasny
2008-01-05 23:32 ` Rafael J. Wysocki
2008-01-06 14:15 ` Gregor Jasny [this message]
2008-01-06 15:17   ` [PATCH] " Ingo Molnar
2008-01-06 22:53   ` [v4l-dvb-maintainer] " Douglas Landgraf
2008-01-06 22:55     ` Douglas Landgraf
2008-01-06 23:22     ` Ingo Molnar
2008-01-07  2:02       ` Douglas Landgraf
2008-01-07  9:43       ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080106141548.GB18690@vidsoft.de \
    --to=jasny@vidsoft.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=rjw@sisk.pl \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.