Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Frank Schaefer and committed by
Mauro Carvalho Chehab
032f1ddf b68cafc5

+4 -3
+4 -3
drivers/media/usb/em28xx/em28xx-video.c
··· 638 638 if (rc) 639 639 return rc; 640 640 641 - if (dev->streaming_users++ == 0) { 641 + if (dev->streaming_users == 0) { 642 642 /* First active streaming user, so allocate all the URBs */ 643 643 644 644 /* Allocate the USB bandwidth */ ··· 657 657 dev->packet_multiplier, 658 658 em28xx_urb_data_copy); 659 659 if (rc < 0) 660 - goto fail; 660 + return rc; 661 661 662 662 /* 663 663 * djh: it's not clear whether this code is still needed. I'm ··· 675 675 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f); 676 676 } 677 677 678 - fail: 678 + dev->streaming_users++; 679 + 679 680 return rc; 680 681 } 681 682