[ovs-dev] [PATCH v2 1/2] datapath: Free skb(s) on recirculation error

Simon Horman horms at verge.net.au
Sun May 11 02:46:27 UTC 2014


It is my understanding that on error execute_recirc() does not free the
skb passed to it.

Assuming this is true then on error skb should always be freed
if an error occurs in execute_recirc().

And if recirc_skb differs from skb, because it is a clone of skb,
then it should also be freed.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 datapath/actions.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/datapath/actions.c b/datapath/actions.c
index 7fe2f54..ffff56d 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -596,8 +596,8 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
 
 			err = execute_recirc(dp, recirc_skb, a);
 
-			if (last_action || err)
-				return err;
+			if (unlikely(err && recirc_skb != skb))
+				kfree_skb(recirc_skb);
 
 			break;
 		}
-- 
1.8.4




More information about the dev mailing list