Skip to content

Commit

Permalink
cdc-phonet: fix skb truesize underestimation
Browse files Browse the repository at this point in the history
Now skb_add_rx_frag() has a truesize parameter, we can fix cdc-phonet to
properly account truesize of each fragment : a full page.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Mar 28, 2012
1 parent 21dcda6 commit 094b585
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/usb/cdc-phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ static void rx_complete(struct urb *req)
memcpy(skb_put(skb, 1), page_address(page), 1);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
page, 1, req->actual_length,
req->actual_length);
PAGE_SIZE);
page = NULL;
}
} else {
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
page, 0, req->actual_length,
req->actual_length);
PAGE_SIZE);
page = NULL;
}
if (req->actual_length < PAGE_SIZE)
Expand Down

0 comments on commit 094b585

Please sign in to comment.