diff options
author | Ezequiel Garcia <ezequiel@collabora.com> | 2019-02-28 10:28:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-31 06:46:29 -0700 |
commit | 356f05fdd4901e18f17d5a9e1c193fe13bde0de4 (patch) | |
tree | c8c79f7243a8787e854c918647196691432159db | |
parent | 2a9331ced5251a531bb73994d0596d9ff4b6ea1b (diff) | |
download | linux-stable-356f05fdd4901e18f17d5a9e1c193fe13bde0de4.tar.gz linux-stable-356f05fdd4901e18f17d5a9e1c193fe13bde0de4.tar.bz2 linux-stable-356f05fdd4901e18f17d5a9e1c193fe13bde0de4.zip |
media: gspca: Kill URBs on USB device disconnect
[ Upstream commit 9b9ea7c2b57a0c9c3341fc6db039d1f7971a432e ]
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: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/media/usb/gspca/gspca.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 405a6a76d820..fd4a1456b6ca 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; @@ -1630,6 +1630,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); |