Commit b1c4294f authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Greg Kroah-Hartman

media: gspca: Kill URBs on USB device disconnect

[ Upstream commit 9b9ea7c2 ]

In order to prevent ISOC URBs from being infinitely resubmitted,
the driver's USB disconnect handler must kill all the in-flight URBs.

While here, change the URB packet status message to a debug level,
to avoid spamming the console too much.

This commit fixes a lockup caused by an interrupt storm coming
from the URB completion handler.
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7e8750d0
...@@ -294,7 +294,7 @@ static void fill_frame(struct gspca_dev *gspca_dev, ...@@ -294,7 +294,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
/* check the packet status and length */ /* check the packet status and length */
st = urb->iso_frame_desc[i].status; st = urb->iso_frame_desc[i].status;
if (st) { 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); i, len, st);
gspca_dev->last_packet_type = DISCARD_PACKET; gspca_dev->last_packet_type = DISCARD_PACKET;
continue; continue;
...@@ -1638,6 +1638,8 @@ void gspca_disconnect(struct usb_interface *intf) ...@@ -1638,6 +1638,8 @@ void gspca_disconnect(struct usb_interface *intf)
mutex_lock(&gspca_dev->usb_lock); mutex_lock(&gspca_dev->usb_lock);
gspca_dev->present = false; gspca_dev->present = false;
destroy_urbs(gspca_dev);
gspca_input_destroy_urb(gspca_dev);
vb2_queue_error(&gspca_dev->queue); vb2_queue_error(&gspca_dev->queue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment