Skip to content

Commit

Permalink
[media] saa7164: saa7164-buffer.c line 274 bugfix
Browse files Browse the repository at this point in the history
Mark buffers free when the dvb dma engine stops.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 2e732d6 commit a1c592b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/media/video/saa7164/saa7164-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ static int saa7164_dvb_pause_port(struct saa7164_port *port)
static int saa7164_dvb_stop_streaming(struct saa7164_port *port)
{
struct saa7164_dev *dev = port->dev;
struct saa7164_buffer *buf;
struct list_head *p, *q;
int ret;

dprintk(DBGLVL_DVB, "%s(port=%d)\n", __func__, port->nr);
Expand All @@ -151,6 +153,14 @@ static int saa7164_dvb_stop_streaming(struct saa7164_port *port)
ret = saa7164_dvb_acquire_port(port);
ret = saa7164_dvb_stop_port(port);

/* Mark the hardware buffers as free */
mutex_lock(&port->dmaqueue_lock);
list_for_each_safe(p, q, &port->dmaqueue.list) {
buf = list_entry(p, struct saa7164_buffer, list);
buf->flags = SAA7164_BUFFER_FREE;
}
mutex_unlock(&port->dmaqueue_lock);

return ret;
}

Expand Down

0 comments on commit a1c592b

Please sign in to comment.