Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f_phonet: fix page offset of first received fragment

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>

authored by

Rémi Denis-Courmont and committed by
David S. Miller
38ff1edb 102463b1

+1 -1
+1 -1
drivers/usb/gadget/f_phonet.c
··· 346 346 } 347 347 348 348 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, 349 - skb->len == 0, req->actual); 349 + skb->len <= 1, req->actual); 350 350 page = NULL; 351 351 352 352 if (req->actual < req->length) { /* Last fragment */