Skip to content

Commit

Permalink
V4L/DVB (6944a): Fix Regression VIDIOCGMBUF ioctl hangs on bttv driver
Browse files Browse the repository at this point in the history
Fix bttv VIDIOCGMBUF locking like done in commit
820eacd. 

Signed-off-by: Gregor Jasny <gjasny@web.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Gregor Jasny authored and Mauro Carvalho Chehab committed Jan 7, 2008
1 parent 3ce5445 commit d9030f5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3063,19 +3063,17 @@ 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));
mbuf->frames = gbuffers;
mbuf->size = gbuffers * gbufsize;
for (i = 0; i < gbuffers; i++)
mbuf->offsets[i] = i * gbufsize;
mutex_unlock(&fh->cap.lock);
return 0;
}
case VIDIOCMCAPTURE:
Expand Down

0 comments on commit d9030f5

Please sign in to comment.