linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hayes Wang <hayeswang@realtek.com>
To: <netdev@vger.kernel.org>
Cc: <nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>,
	Hayes Wang <hayeswang@realtek.com>
Subject: [PATCH net-next] r8152: fix accessing skb after napi_gro_receive
Date: Mon, 19 Aug 2019 11:15:19 +0800	[thread overview]
Message-ID: <1394712342-15778-302-Taiwan-albertk@realtek.com> (raw)
In-Reply-To: <1394712342-15778-299-albertk@realtek.com>

Fix accessing skb after napi_gro_receive which is caused by
commit 47922fcde536 ("r8152: support skb_add_rx_frag").

Fixes: 47922fcde536 ("r8152: support skb_add_rx_frag")
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 40d18e866269..b1db6df6f4ab 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2094,10 +2094,10 @@ static int rx_bottom(struct r8152 *tp, int budget)
 			skb->protocol = eth_type_trans(skb, netdev);
 			rtl_rx_vlan_tag(rx_desc, skb);
 			if (work_done < budget) {
-				napi_gro_receive(napi, skb);
 				work_done++;
 				stats->rx_packets++;
 				stats->rx_bytes += skb->len;
+				napi_gro_receive(napi, skb);
 			} else {
 				__skb_queue_tail(&tp->rx_queue, skb);
 			}
-- 
2.21.0


  parent reply	other threads:[~2019-08-19  3:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1394712342-15778-289-Taiwan-albertk@realtek.com>
2019-08-13  3:42 ` [PATCH net-next v2 0/5] r8152: RX improve Hayes Wang
2019-08-13  3:42   ` [PATCH net-next v2 1/5] r8152: separate the rx buffer size Hayes Wang
2019-08-13  3:42   ` [PATCH net-next v2 2/5] r8152: replace array with linking list for rx information Hayes Wang
2019-08-13  3:42   ` [PATCH net-next v2 3/5] r8152: use alloc_pages for rx buffer Hayes Wang
2019-08-13  3:42   ` [PATCH net-next v2 4/5] r8152: support skb_add_rx_frag Hayes Wang
2019-08-16  6:42     ` Eric Dumazet
2019-08-19  3:15     ` Hayes Wang [this message]
2019-08-20  1:13       ` [PATCH net-next] r8152: fix accessing skb after napi_gro_receive David Miller
2019-08-29 16:31       ` Eric Dumazet
2019-09-02  3:11         ` Hayes Wang
2019-08-13  3:42   ` [PATCH net-next v2 5/5] r8152: change rx_copybreak and rx_pending through ethtool Hayes Wang
2019-08-14  1:15   ` [PATCH net-next v2 0/5] r8152: RX improve Jakub Kicinski

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=1394712342-15778-302-Taiwan-albertk@realtek.com \
    --to=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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;
as well as URLs for NNTP newsgroup(s).