Commit 2970c492 authored by Hartmut Birr's avatar Hartmut Birr Committed by Mauro Carvalho Chehab

V4L/DVB (5545): Saa7146: Release capture buffers on device close

If the video device (saa7146 on a FF card) was open for capturing,
the close call didn't release the capture buffers.
Signed-off-by: default avatarHartmut Birr <e9hack@gmail.com>
Signed-off-by: default avatarOliver Endriss <o.endriss@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent dc120b07
...@@ -1428,6 +1428,7 @@ static void video_close(struct saa7146_dev *dev, struct file *file) ...@@ -1428,6 +1428,7 @@ static void video_close(struct saa7146_dev *dev, struct file *file)
{ {
struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data; struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
struct videobuf_queue *q = &fh->video_q;
int err; int err;
if (IS_CAPTURE_ACTIVE(fh) != 0) { if (IS_CAPTURE_ACTIVE(fh) != 0) {
...@@ -1436,6 +1437,11 @@ static void video_close(struct saa7146_dev *dev, struct file *file) ...@@ -1436,6 +1437,11 @@ static void video_close(struct saa7146_dev *dev, struct file *file)
err = saa7146_stop_preview(fh); err = saa7146_stop_preview(fh);
} }
// release all capture buffers
mutex_lock(&q->lock);
videobuf_read_stop(q);
mutex_unlock(&q->lock);
/* hmm, why is this function declared void? */ /* hmm, why is this function declared void? */
/* return err */ /* return err */
} }
......
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