LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2/2] usbatm: Detect usb device shutdown and ignore failed urbs.
@ 2007-02-21 21:39 Simon Arlott
  2007-02-22 10:43 ` Duncan Sands
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Arlott @ 2007-02-21 21:39 UTC (permalink / raw)
  To: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

Detect usb device shutdown and ignore failed urbs. This happens when the driver is unloaded or the device is unplugged.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
 drivers/usb/atm/usbatm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index 83cea01..1f5faee 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -274,6 +274,10 @@ static void usbatm_complete(struct urb *
 			(!(channel->usbatm->flags & UDSL_IGNORE_EILSEQ) ||
 			 urb->status != -EILSEQ ))
 	{
+		/* the module/device has probably been removed */
+		if (urb->status == -ESHUTDOWN)
+			return;
+
 		if (printk_ratelimit())
 			atm_warn(channel->usbatm, "%s: urb 0x%p failed (%d)!\n",
 				__func__, urb, urb->status);
-- 
1.4.3.1


-- 
Simon Arlott


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 829 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-02-23 18:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-21 21:39 [PATCH 2/2] usbatm: Detect usb device shutdown and ignore failed urbs Simon Arlott
2007-02-22 10:43 ` Duncan Sands
2007-02-22 23:53   ` Pete Zaitcev
2007-02-23  9:36     ` Duncan Sands
2007-02-23 16:16       ` [linux-usb-devel] " Alan Stern
2007-02-23 17:05         ` Duncan Sands
2007-02-23 18:11           ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).