]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/linux/0010-hyperv-Fix-a-bug-in-netvsc_start_xmit.patch
util-linux: update rootfile (armv5tel)
[ipfire-2.x.git] / src / patches / linux / 0010-hyperv-Fix-a-bug-in-netvsc_start_xmit.patch
CommitLineData
a7b0967d
MT
1From b3e774263908a834c1c0d5abf3a7658280e42fc7 Mon Sep 17 00:00:00 2001
2From: KY Srinivasan <kys@microsoft.com>
3Date: Sun, 28 Sep 2014 22:16:43 -0700
4Subject: [PATCH 10/11] hyperv: Fix a bug in netvsc_start_xmit()
5
6[ Upstream commit dedb845ded56ded1c62f5398a94ffa8615d4592d ]
7
8After the packet is successfully sent, we should not touch the skb
9as it may have been freed. This patch is based on the work done by
10Long Li <longli@microsoft.com>.
11
12In this version of the patch I have fixed issues pointed out by David.
13David, please queue this up for stable.
14
15Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
16Tested-by: Long Li <longli@microsoft.com>
17Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 drivers/net/hyperv/netvsc_drv.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
25index 4fd71b75e666..f15297201777 100644
26--- a/drivers/net/hyperv/netvsc_drv.c
27+++ b/drivers/net/hyperv/netvsc_drv.c
28@@ -387,6 +387,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
29 int hdr_offset;
30 u32 net_trans_info;
31 u32 hash;
32+ u32 skb_length = skb->len;
33
34
35 /* We will atmost need two pages to describe the rndis
36@@ -562,7 +563,7 @@ do_send:
37
38 drop:
39 if (ret == 0) {
40- net->stats.tx_bytes += skb->len;
41+ net->stats.tx_bytes += skb_length;
42 net->stats.tx_packets++;
43 } else {
44 kfree(packet);
45--
462.4.3
47