aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 90dec2955f1c..9db219d513db 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -994,13 +994,16 @@ static void em28xx_stop_streaming(struct vb2_queue *vq)
994 } 994 }
995 995
996 spin_lock_irqsave(&dev->slock, flags); 996 spin_lock_irqsave(&dev->slock, flags);
997 if (dev->usb_ctl.vid_buf != NULL) {
998 vb2_buffer_done(&dev->usb_ctl.vid_buf->vb, VB2_BUF_STATE_ERROR);
999 dev->usb_ctl.vid_buf = NULL;
1000 }
997 while (!list_empty(&vidq->active)) { 1001 while (!list_empty(&vidq->active)) {
998 struct em28xx_buffer *buf; 1002 struct em28xx_buffer *buf;
999 buf = list_entry(vidq->active.next, struct em28xx_buffer, list); 1003 buf = list_entry(vidq->active.next, struct em28xx_buffer, list);
1000 list_del(&buf->list); 1004 list_del(&buf->list);
1001 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); 1005 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
1002 } 1006 }
1003 dev->usb_ctl.vid_buf = NULL;
1004 spin_unlock_irqrestore(&dev->slock, flags); 1007 spin_unlock_irqrestore(&dev->slock, flags);
1005} 1008}
1006 1009
@@ -1021,13 +1024,16 @@ void em28xx_stop_vbi_streaming(struct vb2_queue *vq)
1021 } 1024 }
1022 1025
1023 spin_lock_irqsave(&dev->slock, flags); 1026 spin_lock_irqsave(&dev->slock, flags);
1027 if (dev->usb_ctl.vbi_buf != NULL) {
1028 vb2_buffer_done(&dev->usb_ctl.vbi_buf->vb, VB2_BUF_STATE_ERROR);
1029 dev->usb_ctl.vbi_buf = NULL;
1030 }
1024 while (!list_empty(&vbiq->active)) { 1031 while (!list_empty(&vbiq->active)) {
1025 struct em28xx_buffer *buf; 1032 struct em28xx_buffer *buf;
1026 buf = list_entry(vbiq->active.next, struct em28xx_buffer, list); 1033 buf = list_entry(vbiq->active.next, struct em28xx_buffer, list);
1027 list_del(&buf->list); 1034 list_del(&buf->list);
1028 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); 1035 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
1029 } 1036 }
1030 dev->usb_ctl.vbi_buf = NULL;
1031 spin_unlock_irqrestore(&dev->slock, flags); 1037 spin_unlock_irqrestore(&dev->slock, flags);
1032} 1038}
1033 1039