Commit d9030f57 authored by Gregor Jasny's avatar Gregor Jasny Committed by Mauro Carvalho Chehab

V4L/DVB (6944a): Fix Regression VIDIOCGMBUF ioctl hangs on bttv driver

Fix bttv VIDIOCGMBUF locking like done in commit
820eacd8. 
Signed-off-by: default avatarGregor Jasny <gjasny@web.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 3ce54450
...@@ -3063,11 +3063,10 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, ...@@ -3063,11 +3063,10 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
struct video_mbuf *mbuf = arg; struct video_mbuf *mbuf = arg;
unsigned int i; unsigned int i;
mutex_lock(&fh->cap.lock);
retval = videobuf_mmap_setup(&fh->cap,gbuffers,gbufsize, retval = videobuf_mmap_setup(&fh->cap,gbuffers,gbufsize,
V4L2_MEMORY_MMAP); V4L2_MEMORY_MMAP);
if (retval < 0) if (retval < 0)
goto fh_unlock_and_return; return retval;
gbuffers = retval; gbuffers = retval;
memset(mbuf,0,sizeof(*mbuf)); memset(mbuf,0,sizeof(*mbuf));
...@@ -3075,7 +3074,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, ...@@ -3075,7 +3074,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
mbuf->size = gbuffers * gbufsize; mbuf->size = gbuffers * gbufsize;
for (i = 0; i < gbuffers; i++) for (i = 0; i < gbuffers; i++)
mbuf->offsets[i] = i * gbufsize; mbuf->offsets[i] = i * gbufsize;
mutex_unlock(&fh->cap.lock);
return 0; return 0;
} }
case VIDIOCMCAPTURE: case VIDIOCMCAPTURE:
......
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