f_phonet: fix page offset of first received fragment
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Thu, 17 Nov 2011 02:58:55 +0000 (02:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Nov 2011 22:03:02 +0000 (17:03 -0500)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/usb/gadget/f_phonet.c

index 3490770..16a509a 100644 (file)
@@ -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 */