[ovs-dev,ovn] ovn-controller.c: Fix memory leak of local_datapath->ports.
diff mbox series

Message ID 1571701742-49173-1-git-send-email-hzhou@ovn.org
State New
Headers show
Series
  • [ovs-dev,ovn] ovn-controller.c: Fix memory leak of local_datapath->ports.
Related show

Commit Message

Han Zhou Oct. 21, 2019, 11:49 p.m. UTC
Fixes: 89f5048f960c ("ovn-controller: Minimize SB DB port_binding lookups.")
Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 controller/ovn-controller.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Numan Siddique Oct. 22, 2019, 6:27 a.m. UTC | #1
On Tue, Oct 22, 2019 at 5:19 AM Han Zhou <hzhou@ovn.org> wrote:

> Fixes: 89f5048f960c ("ovn-controller: Minimize SB DB port_binding
> lookups.")
> Signed-off-by: Han Zhou <hzhou@ovn.org>
>

Acked-by: Numan Siddique <numans@ovn.org>

Numan


> ---
>  controller/ovn-controller.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
> index b46a1d1..9ab98be 100644
> --- a/controller/ovn-controller.c
> +++ b/controller/ovn-controller.c
> @@ -972,6 +972,7 @@ en_runtime_data_cleanup(struct engine_node *node)
>      HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node,
>                          &data->local_datapaths) {
>          free(cur_node->peer_ports);
> +        free(cur_node->ports);
>          hmap_remove(&data->local_datapaths, &cur_node->hmap_node);
>          free(cur_node);
>      }
> @@ -1002,6 +1003,7 @@ en_runtime_data_run(struct engine_node *node)
>          struct local_datapath *cur_node, *next_node;
>          HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node,
> local_datapaths) {
>              free(cur_node->peer_ports);
> +            free(cur_node->ports);
>              hmap_remove(local_datapaths, &cur_node->hmap_node);
>              free(cur_node);
>          }
> --
> 2.1.0
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Dumitru Ceara Oct. 22, 2019, 7:07 a.m. UTC | #2
On Tue, Oct 22, 2019 at 8:28 AM Numan Siddique <numans@ovn.org> wrote:
>
> On Tue, Oct 22, 2019 at 5:19 AM Han Zhou <hzhou@ovn.org> wrote:
>
> > Fixes: 89f5048f960c ("ovn-controller: Minimize SB DB port_binding
> > lookups.")
> > Signed-off-by: Han Zhou <hzhou@ovn.org>
> >
>
> Acked-by: Numan Siddique <numans@ovn.org>
>
> Numan

My bad, thanks Han for fixing this.

Acked-by: Dumitru Ceara <dceara@redhat.com>

>
>
> > ---
> >  controller/ovn-controller.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
> > index b46a1d1..9ab98be 100644
> > --- a/controller/ovn-controller.c
> > +++ b/controller/ovn-controller.c
> > @@ -972,6 +972,7 @@ en_runtime_data_cleanup(struct engine_node *node)
> >      HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node,
> >                          &data->local_datapaths) {
> >          free(cur_node->peer_ports);
> > +        free(cur_node->ports);
> >          hmap_remove(&data->local_datapaths, &cur_node->hmap_node);
> >          free(cur_node);
> >      }
> > @@ -1002,6 +1003,7 @@ en_runtime_data_run(struct engine_node *node)
> >          struct local_datapath *cur_node, *next_node;
> >          HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node,
> > local_datapaths) {
> >              free(cur_node->peer_ports);
> > +            free(cur_node->ports);
> >              hmap_remove(local_datapaths, &cur_node->hmap_node);
> >              free(cur_node);
> >          }
> > --
> > 2.1.0
> >
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Han Zhou Oct. 22, 2019, 8:06 p.m. UTC | #3
On Tue, Oct 22, 2019 at 12:08 AM Dumitru Ceara <dceara@redhat.com> wrote:
>
> On Tue, Oct 22, 2019 at 8:28 AM Numan Siddique <numans@ovn.org> wrote:
> >
> > On Tue, Oct 22, 2019 at 5:19 AM Han Zhou <hzhou@ovn.org> wrote:
> >
> > > Fixes: 89f5048f960c ("ovn-controller: Minimize SB DB port_binding
> > > lookups.")
> > > Signed-off-by: Han Zhou <hzhou@ovn.org>
> > >
> >
> > Acked-by: Numan Siddique <numans@ovn.org>
> >
> > Numan
>
> My bad, thanks Han for fixing this.
>
> Acked-by: Dumitru Ceara <dceara@redhat.com>
>
Thanks Numan and Dumitru. I applied this to master.

Patch
diff mbox series

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index b46a1d1..9ab98be 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -972,6 +972,7 @@  en_runtime_data_cleanup(struct engine_node *node)
     HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node,
                         &data->local_datapaths) {
         free(cur_node->peer_ports);
+        free(cur_node->ports);
         hmap_remove(&data->local_datapaths, &cur_node->hmap_node);
         free(cur_node);
     }
@@ -1002,6 +1003,7 @@  en_runtime_data_run(struct engine_node *node)
         struct local_datapath *cur_node, *next_node;
         HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node, local_datapaths) {
             free(cur_node->peer_ports);
+            free(cur_node->ports);
             hmap_remove(local_datapaths, &cur_node->hmap_node);
             free(cur_node);
         }