diff mbox

cdc-phonet: fix skb truesize underestimation

Message ID 1332854246.3248.18.camel@edumazet-laptop
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet March 27, 2012, 1:17 p.m. UTC
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>
---
 drivers/net/usb/cdc-phonet.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Rémi Denis-Courmont March 27, 2012, 1:22 p.m. UTC | #1
Le mardi 27 mars 2012 06:17:26 ext Eric Dumazet a écrit :
> 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>
David Miller March 28, 2012, 2:51 a.m. UTC | #2
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 27 Mar 2012 06:17:26 -0700

> 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>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 3886b30..3e41b00 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -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)