aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/stk-webcam.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index 8aa56fe02546..a8a72768ca91 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -445,18 +445,19 @@ static void stk_isoc_handler(struct urb *urb)
445 fb->v4lbuf.bytesused = 0; 445 fb->v4lbuf.bytesused = 0;
446 fill = fb->buffer; 446 fill = fb->buffer;
447 } else if (fb->v4lbuf.bytesused == dev->frame_size) { 447 } else if (fb->v4lbuf.bytesused == dev->frame_size) {
448 list_move_tail(dev->sio_avail.next, 448 if (list_is_singular(&dev->sio_avail)) {
449 &dev->sio_full); 449 /* Always reuse the last buffer */
450 wake_up(&dev->wait_frame); 450 fb->v4lbuf.bytesused = 0;
451 if (list_empty(&dev->sio_avail)) { 451 fill = fb->buffer;
452 (void) (printk_ratelimit() && 452 } else {
453 STK_ERROR("No buffer available\n")); 453 list_move_tail(dev->sio_avail.next,
454 goto resubmit; 454 &dev->sio_full);
455 wake_up(&dev->wait_frame);
456 fb = list_first_entry(&dev->sio_avail,
457 struct stk_sio_buffer, list);
458 fb->v4lbuf.bytesused = 0;
459 fill = fb->buffer;
455 } 460 }
456 fb = list_first_entry(&dev->sio_avail,
457 struct stk_sio_buffer, list);
458 fb->v4lbuf.bytesused = 0;
459 fill = fb->buffer;
460 } 461 }
461 } else { 462 } else {
462 framelen -= 4; 463 framelen -= 4;