datapath: Fix a double free bug for the sample action
[sliver-openvswitch.git] / datapath / actions.c
index 0b66e7c..82cfd2d 100644 (file)
@@ -552,6 +552,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;
                }