Commit 170229d1 authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

greybus: don't restrict input buffer size

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent a06df4b0
...@@ -305,10 +305,9 @@ static void cport_in_callback(struct urb *urb) ...@@ -305,10 +305,9 @@ static void cport_in_callback(struct urb *urb)
if (status) if (status)
return; return;
/* The size has to be more then just an "empty" transfer */ /* The size has to be at least one, for the cport id */
if (urb->actual_length <= 2) { if (!urb->actual_length) {
dev_err(dev, "%s: \"short\" cport in transfer of %d bytes?\n", dev_err(dev, "%s: no cport id in input buffer?\n", __func__);
__func__, urb->actual_length);
goto exit; goto exit;
} }
...@@ -338,10 +337,6 @@ static void cport_out_callback(struct urb *urb) ...@@ -338,10 +337,6 @@ static void cport_out_callback(struct urb *urb)
unsigned long flags; unsigned long flags;
int i; 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 * See if this was an urb in our pool, if so mark it "free", otherwise
* we need to free it ourselves. * we need to free it ourselves.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment