public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, netdev <netdev@vger.kernel.org>,
	"Felipe Balbi" <balbi@ti.com>,
	"Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
Subject: [PATCH] cdc-phonet: fix skb truesize underestimation
Date: Tue, 27 Mar 2012 06:17:26 -0700	[thread overview]
Message-ID: <1332854246.3248.18.camel@edumazet-laptop> (raw)
In-Reply-To: <1332853442.3248.15.camel@edumazet-laptop>

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

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)

  reply	other threads:[~2012-03-27 13:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 13:04 [PATCH] f_phonet: fix skb truesize underestimation Eric Dumazet
2012-03-27 13:17 ` Eric Dumazet [this message]
2012-03-27 13:22   ` [PATCH] cdc-phonet: " Rémi Denis-Courmont
2012-03-28  2:51   ` David Miller
2012-03-28  2:51 ` [PATCH] f_phonet: " David Miller
2012-03-28  8:55   ` Felipe Balbi
2012-03-28  9:33     ` David Miller
     [not found]       ` <20120328.053310.219141897175161116.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-03-28 12:43         ` Felipe Balbi
     [not found]           ` <20120328124314.GG28319-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-03-29  2:15             ` Paul Gortmaker
     [not found]   ` <20120327.225109.752822925052179338.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-03-29  6:30     ` Rémi Denis-Courmont
2012-03-29  6:46       ` Eric Dumazet
2012-03-29  6:51       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332854246.3248.18.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=balbi@ti.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=remi.denis-courmont@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox