When ofm is not referenced by xc_entry, we should release its
resources by calling ofproto_flow_mod_uninit because no one is
going to use it in this function.

Signed-off-by: Yifeng Sun <[email protected]>
---
 ofproto/ofproto-dpif-xlate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 468cd160c60e..fcced344ed8a 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -5123,6 +5123,8 @@ xlate_learn_action(struct xlate_ctx *ctx, const struct 
ofpact_learn *learn)
                 entry->learn.ofm = ofm;
                 entry->learn.limit = learn->limit;
                 ofm = NULL;
+            } else {
+                ofproto_flow_mod_uninit(ofm);
             }
 
             if (OVS_UNLIKELY(ctx->xin->trace && !success)) {
-- 
2.7.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to