Skip to contentSkip to conversation

f_phonet: fix page offset of first received fragment

PATCH Applied Rémi Denis-Courmont 2 participants 2 messages Nov 17, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f_phonet: fix page offset of first received fragment

From: Rémi Denis-Courmont <[email protected]>

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.

---
 drivers/usb/gadget/f_phonet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/gadget/f_phonet.c +1 -1
index 3490770..16a509a 100644
@@ -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 */
Signature · 1 line
1.7.5.4