summaryrefslogtreecommitdiff
path: root/drivers/net/usb/cdc-phonet.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-03-24 03:59:33 +0400
committerDavid S. Miller <davem@davemloft.net>2012-03-25 21:29:58 +0400
commit50269e19ad990e79eeda101fc6df80cffd5d4831 (patch)
tree903d80ba1b1fc0eb15e122a8c12a72f72e7ed2de /drivers/net/usb/cdc-phonet.c
parent0015e551edb1d28191567d8a7d1ce5edda404ced (diff)
downloadlinux-50269e19ad990e79eeda101fc6df80cffd5d4831.tar.xz
net: add a truesize parameter to skb_add_rx_frag()
skb_add_rx_frag() API is misleading. Network skbs built with this helper can use uncharged kernel memory and eventually stress/crash machine in OOM. Add a 'truesize' parameter and then fix drivers in followup patches. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/cdc-phonet.c')
-rw-r--r--drivers/net/usb/cdc-phonet.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 790cbdea7392..3886b30ed373 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -164,12 +164,14 @@ static void rx_complete(struct urb *req)
/* Can't use pskb_pull() on page in IRQ */
memcpy(skb_put(skb, 1), page_address(page), 1);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
- page, 1, req->actual_length);
+ page, 1, req->actual_length,
+ req->actual_length);
page = NULL;
}
} else {
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
- page, 0, req->actual_length);
+ page, 0, req->actual_length,
+ req->actual_length);
page = NULL;
}
if (req->actual_length < PAGE_SIZE)