summaryrefslogtreecommitdiff
path: root/drivers/media/usb/gspca/gspca.c
diff options
context:
space:
mode:
authorpopcornmix <popcornmix@gmail.com>2019-06-10 15:08:23 +0100
committerpopcornmix <popcornmix@gmail.com>2019-06-10 15:08:23 +0100
commit4395da03133888a4d2ea920dfb88d04e7534038d (patch)
tree82770cb27e36df3aa4433a4a0a3e53a2f88a05b1 /drivers/media/usb/gspca/gspca.c
parent6b45ec4c1518201aed352f9c9a852613adfd6efb (diff)
parentbb7b450e61a1dbe2bfbe998a1afeda654c6a67e9 (diff)
downloadlinux-rpi3-4395da03133888a4d2ea920dfb88d04e7534038d.tar.gz
linux-rpi3-4395da03133888a4d2ea920dfb88d04e7534038d.tar.bz2
linux-rpi3-4395da03133888a4d2ea920dfb88d04e7534038d.zip
Merge remote-tracking branch 'stable/linux-4.19.y' into rpi-4.19.y
Diffstat (limited to 'drivers/media/usb/gspca/gspca.c')
-rw-r--r--drivers/media/usb/gspca/gspca.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 405a6a76d820..b12356c533a6 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -294,7 +294,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
/* check the packet status and length */
st = urb->iso_frame_desc[i].status;
if (st) {
- pr_err("ISOC data error: [%d] len=%d, status=%d\n",
+ gspca_dbg(gspca_dev, D_PACK, "ISOC data error: [%d] len=%d, status=%d\n",
i, len, st);
gspca_dev->last_packet_type = DISCARD_PACKET;
continue;
@@ -314,6 +314,8 @@ static void fill_frame(struct gspca_dev *gspca_dev,
}
resubmit:
+ if (!gspca_dev->streaming)
+ return;
/* resubmit the URB */
st = usb_submit_urb(urb, GFP_ATOMIC);
if (st < 0)
@@ -330,7 +332,7 @@ static void isoc_irq(struct urb *urb)
struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
gspca_dbg(gspca_dev, D_PACK, "isoc irq\n");
- if (!vb2_start_streaming_called(&gspca_dev->queue))
+ if (!gspca_dev->streaming)
return;
fill_frame(gspca_dev, urb);
}
@@ -344,7 +346,7 @@ static void bulk_irq(struct urb *urb)
int st;
gspca_dbg(gspca_dev, D_PACK, "bulk irq\n");
- if (!vb2_start_streaming_called(&gspca_dev->queue))
+ if (!gspca_dev->streaming)
return;
switch (urb->status) {
case 0:
@@ -367,6 +369,8 @@ static void bulk_irq(struct urb *urb)
urb->actual_length);
resubmit:
+ if (!gspca_dev->streaming)
+ return;
/* resubmit the URB */
if (gspca_dev->cam.bulk_nurbs != 0) {
st = usb_submit_urb(urb, GFP_ATOMIC);
@@ -1630,6 +1634,8 @@ void gspca_disconnect(struct usb_interface *intf)
mutex_lock(&gspca_dev->usb_lock);
gspca_dev->present = false;
+ destroy_urbs(gspca_dev);
+ gspca_input_destroy_urb(gspca_dev);
vb2_queue_error(&gspca_dev->queue);