openvswitch: Fix a double free bug for the sample action

When sample action returns with an error, the skb has already been
freed. This patch fix a bug to make sure we don't free it again.
This bug introduced by commit ccb1352e76 (net: Add Open vSwitch
kernel components.)

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
Andy Zhou 2014-05-06 17:23:48 -07:00 committed by Pravin B Shelar
parent dba63115ce
commit fe984c08e2
1 changed files with 2 additions and 0 deletions

View File

@ -551,6 +551,8 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
case OVS_ACTION_ATTR_SAMPLE:
err = sample(dp, skb, a);
if (unlikely(err)) /* skb already freed. */
return err;
break;
}