[ovs-dev] [PATCH 1/3] ovn-controller: Fix memory leak when updating tunnels.

Jesse Gross jesse at kernel.org
Mon Aug 1 15:45:56 UTC 2016


When a tunnel possibly needs to be updated, we are currently allocating
a new name for it. This is not necessary and in fact nothing uses the
name, which then results in the memory being leaked.

Fixes: 1d45d5a9 ("ovn-controller: Change encaps_run to work incrementally.")
Signed-off-by: Jesse Gross <jesse at kernel.org>
---
 ovn/controller/encaps.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/ovn/controller/encaps.c b/ovn/controller/encaps.c
index 977cc3a..1962324 100644
--- a/ovn/controller/encaps.c
+++ b/ovn/controller/encaps.c
@@ -309,12 +309,7 @@ check_and_update_tunnel(const struct sbrec_chassis *chassis_rec)
         const struct sbrec_encap *encap = preferred_encap(chassis_rec);
         const struct ovsrec_port *port = port_node->port;
         const struct ovsrec_interface *iface = port->interfaces[0];
-        char *port_name = tunnel_create_name(chassis_rec->name);
-        if (!port_name) {
-            VLOG_WARN("Unable to allocate unique name for '%s' tunnel",
-                      chassis_rec->name);
-            return;
-        }
+
         if (strcmp(encap->type, iface->type)) {
             ovsrec_interface_set_type(iface, encap->type);
         }
-- 
2.7.4




More information about the dev mailing list