diff mbox

f_phonet: fix page offset of first received fragment

Message ID 1321534735-9949-1-git-send-email-remi@remlab.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Rémi Denis-Courmont Nov. 17, 2011, 12:58 p.m. UTC
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

We pull one byte (the MAC header) from the first fragment before the
fragment is actually appended. So the socket buffer length is 1, not 0.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
 drivers/usb/gadget/f_phonet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

David Miller Nov. 17, 2011, 10:03 p.m. UTC | #1
From: Rémi Denis-Courmont <remi@remlab.net>
Date: Thu, 17 Nov 2011 14:58:55 +0200

> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> 
> We pull one byte (the MAC header) from the first fragment before the
> fragment is actually appended. So the socket buffer length is 1, not 0.
> 
> Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index 3490770..16a509a 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -346,7 +346,7 @@  static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)
 		}
 
 		skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
-				skb->len == 0, req->actual);
+				skb->len <= 1, req->actual);
 		page = NULL;
 
 		if (req->actual < req->length) { /* Last fragment */