Skip to content

Commit

Permalink
f_phonet: fix page offset of first received fragment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Nov 17, 2011
1 parent 102463b commit 38ff1ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 38ff1ed

Please sign in to comment.