diff options
author | Flavio Leitner <fbl@redhat.com> | 2019-04-03 09:49:13 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-04-16 12:26:13 -0700 |
commit | 4dd289c2c377e13c908fe4b608fc748cd7e22bc5 (patch) | |
tree | a97134f6ef85e8f0c1bac20826fa7e5e641ff46d | |
parent | d4f26c39eb1cb422b476a5a699b5f376cc0c40b9 (diff) | |
download | openvswitch-4dd289c2c377e13c908fe4b608fc748cd7e22bc5.tar.gz |
datapath: Revert "datapath: Fix template leak in error cases."
Upstream commit:
commit 7f6d6558ae44bc193eb28df3617c364d3bb6df39
Author: Flavio Leitner <fbl@redhat.com>
Date: Fri Sep 28 14:55:34 2018 -0300
Revert "openvswitch: Fix template leak in error cases."
This reverts commit 90c7afc.
When the commit was merged, the code used nf_ct_put() to free
the entry, but later on commit 7664423 ("openvswitch: Free
tmpl with tmpl_free.") replaced that with nf_ct_tmpl_free which
is a more appropriate. Now the original problem is removed.
Then 44d6e2f ("net: Replace NF_CT_ASSERT() with WARN_ON().")
replaced a debug assert with a WARN_ON() which is trigged now.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Joe Stringer <joe@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This patch backports this upstream patch to OVS.
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r-- | datapath/conntrack.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/datapath/conntrack.c b/datapath/conntrack.c index 3c4e4ec97..750ceaf8b 100644 --- a/datapath/conntrack.c +++ b/datapath/conntrack.c @@ -1347,10 +1347,6 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr, OVS_NLERR(log, "Failed to allocate conntrack template"); return -ENOMEM; } - - __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status); - nf_conntrack_get(&ct_info.ct->ct_general); - if (helper) { err = ovs_ct_add_helper(&ct_info, helper, key, log); if (err) @@ -1362,6 +1358,8 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr, if (err) goto err_free_ct; + __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status); + nf_conntrack_get(&ct_info.ct->ct_general); return 0; err_free_ct: __ovs_ct_free_action(&ct_info); |