]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: fix repeated input errors
authorAlex Elder <elder@linaro.org>
Fri, 24 Oct 2014 10:02:02 +0000 (05:02 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 24 Oct 2014 10:36:24 +0000 (18:36 +0800)
I screwed up the error handling in a patch the other day.  If we get
an error on an input URB we should not re-submit it.

Signed-off-by: Alex Elder <elder@linaro.org>
drivers/staging/greybus/es1-ap-usb.c

index 12eb9b2bee0f074b2ec55f56698f9defe9d42565..bd416b4849bd68a44103d7bac9a69a174f7928a0 100644 (file)
@@ -319,9 +319,10 @@ static void svc_in_callback(struct urb *urb)
        int retval;
 
        if (status) {
-               if (status != -EAGAIN)
-                       dev_err(dev, "urb svc in error %d (dropped)\n", status);
-               goto exit;
+               if (status == -EAGAIN)
+                       goto exit;
+               dev_err(dev, "urb svc in error %d (dropped)\n", status);
+               return;
        }
 
        /* We have a message, create a new message structure, add it to the
@@ -346,10 +347,10 @@ static void cport_in_callback(struct urb *urb)
        u8 *data;
 
        if (status) {
-               if (status != -EAGAIN)
-                       dev_err(dev, "urb cport in error %d (dropped)\n",
-                               status);
-               goto exit;
+               if (status == -EAGAIN)
+                       goto exit;
+               dev_err(dev, "urb cport in error %d (dropped)\n", status);
+               return;
        }
 
        /* The size has to be at least one, for the cport id */