From 6ca5840e489ee880ed22e581ff406f5394bed25e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 5 Aug 2008 14:35:26 -0700 Subject: [PATCH] Fix memory leak when OFPP_TABLE is used for a packet that matches no flow. --- datapath/datapath.c | 1 + switch/datapath.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/datapath/datapath.c b/datapath/datapath.c index 193a4526..28da3bb7 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -554,6 +554,7 @@ int dp_output_port(struct datapath *dp, struct sk_buff *skb, int out_port) execute_actions(dp, skb, &key, flow->actions, flow->n_actions); return 0; } + kfree_skb(skb); return -ESRCH; } else if (out_port == OFPP_LOCAL) { struct net_device *dev = dp->netdev; diff --git a/switch/datapath.c b/switch/datapath.c index e1ae5186..4ec436e0 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -556,6 +556,8 @@ dp_output_port(struct datapath *dp, struct buffer *buffer, flow_used(flow, buffer); execute_actions(dp, buffer, in_port, &key, flow->actions, flow->n_actions); + } else { + buffer_delete(buffer); } } else { output_packet(dp, buffer, out_port); -- 2.30.2