Commit 820eacd8 authored by Brandon Philips's avatar Brandon Philips Committed by Mauro Carvalho Chehab

V4L/DVB (6615): V4L: Fix VIDIOCGMBUF locking in saa7146

Fallout from videobuf_mmap_setup() locking fixes.
Signed-off-by: default avatarBrandon Philips <bphilips@suse.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 053fcb60
...@@ -1205,13 +1205,10 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -1205,13 +1205,10 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
DEB_D(("VIDIOCGMBUF \n")); DEB_D(("VIDIOCGMBUF \n"));
q = &fh->video_q; q = &fh->video_q;
mutex_lock(&q->lock);
err = videobuf_mmap_setup(q,gbuffers,gbufsize, err = videobuf_mmap_setup(q,gbuffers,gbufsize,
V4L2_MEMORY_MMAP); V4L2_MEMORY_MMAP);
if (err < 0) { if (err < 0)
mutex_unlock(&q->lock);
return err; return err;
}
gbuffers = err; gbuffers = err;
memset(mbuf,0,sizeof(*mbuf)); memset(mbuf,0,sizeof(*mbuf));
...@@ -1219,7 +1216,6 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -1219,7 +1216,6 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
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(&q->lock);
return 0; return 0;
} }
#endif #endif
......
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