Skip to content

Commit

Permalink
openvswitch: Fix a double free bug for the sample action
Browse files Browse the repository at this point in the history
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 ccb1352 (net: Add Open vSwitch
kernel components.)

Signed-off-by: Andy Zhou <[email protected]>
Signed-off-by: Pravin B Shelar <[email protected]>
  • Loading branch information
azhou-nicira authored and Pravin B Shelar committed Jun 29, 2014
1 parent dba6311 commit fe984c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/openvswitch/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fe984c0

Please sign in to comment.