Fix memory leak when OFPP_TABLE is used for a packet that matches no flow.
authorBen Pfaff <blp@nicira.com>
Tue, 5 Aug 2008 21:35:26 +0000 (14:35 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 7 Aug 2008 17:23:06 +0000 (10:23 -0700)
datapath/datapath.c
switch/datapath.c

index 193a452..28da3bb 100644 (file)
@@ -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;
index e1ae518..4ec436e 100644 (file)
@@ -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);