aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2013-10-10 14:31:53 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-10-17 05:07:36 -0400
commit032f1ddf67e3e7da1a04995f5c322ded6805cbf4 (patch)
treef128d0678c2bf588d3f13a83086d518382c754d6 /drivers/media/usb/em28xx/em28xx-video.c
parentb68cafc5ae5470648b9f90fe0846675d8c03e691 (diff)
[media] em28xx: fix error path in em28xx_start_analog_streaming()
Increase the streaming_users count only if streaming start succeeds. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 9d103344f34a..fc5d60efd4ab 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -638,7 +638,7 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
638 if (rc) 638 if (rc)
639 return rc; 639 return rc;
640 640
641 if (dev->streaming_users++ == 0) { 641 if (dev->streaming_users == 0) {
642 /* First active streaming user, so allocate all the URBs */ 642 /* First active streaming user, so allocate all the URBs */
643 643
644 /* Allocate the USB bandwidth */ 644 /* Allocate the USB bandwidth */
@@ -657,7 +657,7 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
657 dev->packet_multiplier, 657 dev->packet_multiplier,
658 em28xx_urb_data_copy); 658 em28xx_urb_data_copy);
659 if (rc < 0) 659 if (rc < 0)
660 goto fail; 660 return rc;
661 661
662 /* 662 /*
663 * djh: it's not clear whether this code is still needed. I'm 663 * djh: it's not clear whether this code is still needed. I'm
@@ -675,7 +675,8 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
675 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f); 675 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
676 } 676 }
677 677
678fail: 678 dev->streaming_users++;
679
679 return rc; 680 return rc;
680} 681}
681 682