]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: don't restrict input buffer size
authorAlex Elder <elder@linaro.org>
Thu, 16 Oct 2014 11:35:27 +0000 (06:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:12:00 +0000 (18:12 +0200)
Don't assume that input buffers have any particular content.  The
only thing the gbuf layer needs to be concerned with is the presence
of the cport_id byte at the beginning of a transfer.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/es1-ap-usb.c

index 1a67d9e15c2aa44a7df2c5e4776feb176160a9d9..e55ad03b56d6b51503ace31f369d2c11db082e9d 100644 (file)
@@ -305,10 +305,9 @@ static void cport_in_callback(struct urb *urb)
        if (status)
                return;
 
-       /* The size has to be more then just an "empty" transfer */
-       if (urb->actual_length <= 2) {
-               dev_err(dev, "%s: \"short\" cport in transfer of %d bytes?\n",
-                       __func__, urb->actual_length);
+       /* The size has to be at least one, for the cport id */
+       if (!urb->actual_length) {
+               dev_err(dev, "%s: no cport id in input buffer?\n", __func__);
                goto exit;
        }
 
@@ -338,10 +337,6 @@ static void cport_out_callback(struct urb *urb)
        unsigned long flags;
        int i;
 
-       /* If no error, tell the core the gbuf is properly sent */
-       if (!check_urb_status(urb))
-               greybus_gbuf_finished(gbuf);
-
        /*
         * See if this was an urb in our pool, if so mark it "free", otherwise
         * we need to free it ourselves.