[ovs-dev] [PATCH] ofproto-dpif-upcall: Fix a memory leak.

Alex Wang alexw at nicira.com
Mon Sep 23 17:06:53 UTC 2013


This commit fixes a memory leak in ofproto-dpif-upcall module.
The memory leak is caused by not freeing the 'struct upcall's.

Signed-off-by: Alex Wang <alexw at nicira.com>
---
 ofproto/ofproto-dpif-upcall.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index d75c61b..ec253e1 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -814,6 +814,12 @@ handle_miss_upcalls(struct udpif *udpif, struct list *upcalls)
         }
     }
 
+    /* Frees all remaining upcalls. */
+    LIST_FOR_EACH_SAFE (upcall, next, list_node, upcalls) {
+        list_remove(&upcall->list_node);
+        upcall_destroy(upcall);
+    }
+
     atomic_read(&udpif->reval_seq, &reval_seq);
     if (reval_seq != fmb->reval_seq) {
         COVERAGE_INC(fmb_queue_revalidated);
-- 
1.7.9.5




More information about the dev mailing list