Skip to content

Commit

Permalink
V4L/DVB (6615): V4L: Fix VIDIOCGMBUF locking in saa7146
Browse files Browse the repository at this point in the history
Fallout from videobuf_mmap_setup() locking fixes.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Brandon Philips authored and Mauro Carvalho Chehab committed Dec 11, 2007
1 parent 053fcb6 commit 820eacd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/media/common/saa7146_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,21 +1205,17 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
DEB_D(("VIDIOCGMBUF \n"));

q = &fh->video_q;
mutex_lock(&q->lock);
err = videobuf_mmap_setup(q,gbuffers,gbufsize,
V4L2_MEMORY_MMAP);
if (err < 0) {
mutex_unlock(&q->lock);
if (err < 0)
return err;
}

gbuffers = err;
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(&q->lock);
return 0;
}
#endif
Expand Down

0 comments on commit 820eacd

Please sign in to comment.