From 40dd413d5b5424eb4cd2e6a8558d33f3b7c607ed Mon Sep 17 00:00:00 2001 From: Andy Zhou Date: Tue, 15 Apr 2014 16:28:15 -0700 Subject: [PATCH] datapath: 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. --- datapath/actions.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/datapath/actions.c b/datapath/actions.c index 0b66e7c6e..82cfd2d50 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -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; } -- 2.43.0