diff mbox

[ovs-dev] ofproto-dpif-xlate: Fix the memory leak in netflow.

Message ID FC1AAE34B870124C835BDA1138D00F5C5A937681@DGGEMA501-MBS.china.huawei.com
State Accepted
Headers show

Commit Message

zhangsha (A) March 24, 2017, 7:37 a.m. UTC
From c4066ad97d4f9e39cd80f6d43f0592092423e0b6 Mon Sep 17 00:00:00 2001
From: Sha Zhang <zhangsha.zhang@huawei.com>

Date: Sat, 25 Mar 2017 04:43:56 +0800
Subject: [PATCH] ofproto-dpif-xlate: Fix the memory leak in netflow.

The memory leak was triggered each time on
creating a netflow and subsequently deleting it.

Signed-off-by: Sha Zhang <zhangsha.zhang@huawei.com>

---
ofproto/ofproto-dpif-xlate.c | 1 +
1 file changed, 1 insertion(+)

--
1.8.3.1
_______________________________________________
dev mailing list
dev@openvswitch.org<mailto:dev@openvswitch.org>
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=6OuVHk-mnufSWzkKa74UkQ&m=JhAm1vJk4npjvIQ7bIXYB1koFrUjZzDMzENlPyF-KBA&s=YsnTppTJyve1-wtEQzcV9X0Ew8RxxU3e_qE3LeX5UtA&e=

Comments

Ben Pfaff April 24, 2017, 7:19 p.m. UTC | #1
On Fri, Mar 24, 2017 at 07:37:18AM +0000, zhangsha (A) wrote:
> From c4066ad97d4f9e39cd80f6d43f0592092423e0b6 Mon Sep 17 00:00:00 2001
> From: Sha Zhang <zhangsha.zhang@huawei.com>
> Date: Sat, 25 Mar 2017 04:43:56 +0800
> Subject: [PATCH] ofproto-dpif-xlate: Fix the memory leak in netflow.
> 
> The memory leak was triggered each time on
> creating a netflow and subsequently deleting it.
> 
> Signed-off-by: Sha Zhang <zhangsha.zhang@huawei.com>

Thanks.  The formatting was still not ideal, but I fixed it up and
applied it to master and then backported as far as branch-2.5.
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 6b7a4fe..c1deef5 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -1143,6 +1143,7 @@  xlate_xbridge_remove(struct xlate_cfg *xcfg, struct xbridge *xbridge)
     mbridge_unref(xbridge->mbridge);
     dpif_sflow_unref(xbridge->sflow);
     dpif_ipfix_unref(xbridge->ipfix);
+    netflow_unref(xbridge->netflow);
     stp_unref(xbridge->stp);
     rstp_unref(xbridge->rstp);
     hmap_destroy(&xbridge->xports);
--
1.8.3.1

From: Shashank Ram [mailto:rams@vmware.com]
Sent: 2017年3月24日 9:58
To: zhangsha (A) <zhangsha.zhang@huawei.com>; dev@openvswitch.org
Cc: gaoxiaoqiu <gaoxiaoqiu@huawei.com>
Subject: Re: [ovs-dev] [PATCH] Fix the memleak in Netflow. The memleak was trigged each time creating a netflow and deleting it then.


Hi, could you format the commit message to have the title and description in separate lines as shown below.



"""

ofproto-dpif-xlate.c: Fix a memory leak in Netflow


The memory leak was triggered each time on
creating a netflow and subsequently deleting it.

Signed-off-by: Sha Zhang <zhangsha.zhang@huawei.com<mailto:zhangsha.zhang@huawei.com>>
"""

Thanks,
Shashank
________________________________
From: ovs-dev-bounces@openvswitch.org<mailto:ovs-dev-bounces@openvswitch.org> <ovs-dev-bounces@openvswitch.org<mailto:ovs-dev-bounces@openvswitch.org>> on behalf of zhangsha (A) <zhangsha.zhang@huawei.com<mailto:zhangsha.zhang@huawei.com>>
Sent: Thursday, March 23, 2017 6:52 PM
To: dev@openvswitch.org<mailto:dev@openvswitch.org>
Cc: gaoxiaoqiu
Subject: [ovs-dev] [PATCH] Fix the memleak in Netflow. The memleak was trigged each time creating a netflow and deleting it then.

From d78ceaabadf6c3e684d5260ef5af9d5700c11247 Mon Sep 17 00:00:00 2001
From: Sha Zhang <zhangsha.zhang@huawei.com<mailto:zhangsha.zhang@huawei.com>>
Date: Fri, 24 Mar 2017 22:32:50 +0800
Subject: [PATCH] Fix the memleak in Netflow. The memleak was trigged each time
creating a netflow and deleting it then.

Signed-off-by: Sha Zhang <zhangsha.zhang@huawei.com<mailto:zhangsha.zhang@huawei.com>>
---
ofproto/ofproto-dpif-xlate.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 7df92e5..d02d010 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -1143,6 +1143,7 @@  xlate_xbridge_remove(struct xlate_cfg *xcfg, struct xbridge *xbridge)
     mbridge_unref(xbridge->mbridge);
     dpif_sflow_unref(xbridge->sflow);
     dpif_ipfix_unref(xbridge->ipfix);
+    netflow_unref(xbridge->netflow);
     stp_unref(xbridge->stp);
     rstp_unref(xbridge->rstp);
     hmap_destroy(&xbridge->xports);