summaryrefslogtreecommitdiff
path: root/net/openvswitch/vport.c
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2014-12-23 16:20:32 -0800
committerDavid S. Miller <davem@davemloft.net>2014-12-23 23:57:31 -0500
commit997e068ebc17d8d57e735578df44b6341cd5f2f3 (patch)
tree2fc6e7b30a84898baeb28fd3ec783e292541335c /net/openvswitch/vport.c
parentcbe7e76d94f59e89302bd514e4b685e03d1ebbe4 (diff)
openvswitch: Fix vport_send double free
Today vport-send has complex error handling because it involves freeing skb and updating stats depending on return value from vport send implementation. This can be simplified by delegating responsibility of freeing skb to the vport implementation for all cases. So that vport-send needs just update stats. Fixes: 91b7514cdf ("openvswitch: Unify vport error stats handling") Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/vport.c')
-rw-r--r--net/openvswitch/vport.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 9584526c0778..53f3ebbfceab 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -519,10 +519,9 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb)
u64_stats_update_end(&stats->syncp);
} else if (sent < 0) {
ovs_vport_record_error(vport, VPORT_E_TX_ERROR);
- kfree_skb(skb);
- } else
+ } else {
ovs_vport_record_error(vport, VPORT_E_TX_DROPPED);
-
+ }
return sent;
}