Patchwork [02/18] usb-host: reapurb error report fix

login
register
mail settings
Submitter Gerd Hoffmann
Date Sept. 2, 2011, 9:56 a.m.
Message ID <1314957407-29508-3-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/113084/
State New
Headers show

Comments

Gerd Hoffmann - Sept. 2, 2011, 9:56 a.m.
Don't report errors on devices which are in disconnected
and closing state.
---
 usb-linux.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/usb-linux.c b/usb-linux.c
index 4e4df61..12e8772 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -312,9 +312,11 @@  static void async_complete(void *opaque)
                 }
                 return;
             }
-            if (errno == ENODEV && !s->closing) {
-                trace_usb_host_disconnect(s->bus_num, s->addr);
-                do_disconnect(s);
+            if (errno == ENODEV) {
+                if (!s->closing) {
+                    trace_usb_host_disconnect(s->bus_num, s->addr);
+                    do_disconnect(s);
+                }
                 return;
             }