diff options
author | Andrey Utkin | 2014-11-06 18:06:18 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab | 2014-11-11 08:45:32 -0200 |
commit | 9ccd180964baba5ae150ed91fb9649310f013a5b (patch) | |
tree | 322a94bbe3a39809d18ef9c0604891b6ed7a8f74 /drivers/media/pci | |
parent | 85273c382e185236241f21e0d468f86ca76c1546 (diff) |
[media] solo6x10: clean up properly in stop_streaming
This fixes warning from drivers/media/v4l2-core/videobuf2-core.c,
WARN_ON(atomic_read(&q->owned_by_drv_count)).
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c index 28023f9f1dc7..6cd6a25b25d7 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c @@ -781,9 +781,19 @@ static int solo_enc_start_streaming(struct vb2_queue *q, unsigned int count) static void solo_enc_stop_streaming(struct vb2_queue *q) { struct solo_enc_dev *solo_enc = vb2_get_drv_priv(q); + unsigned long flags; + spin_lock_irqsave(&solo_enc->av_lock, flags); solo_enc_off(solo_enc); - INIT_LIST_HEAD(&solo_enc->vidq_active); + while (!list_empty(&solo_enc->vidq_active)) { + struct solo_vb2_buf *buf = list_entry( + solo_enc->vidq_active.next, + struct solo_vb2_buf, list); + + list_del(&buf->list); + vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); + } + spin_unlock_irqrestore(&solo_enc->av_lock, flags); solo_ring_stop(solo_enc->solo_dev); } |