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>
This commit is contained in:

committed by
David S. Miller

parent
cbe7e76d94
commit
997e068ebc
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user