diff options
author | Yifeng Sun <pkusunyifeng@gmail.com> | 2017-11-15 06:59:24 -0800 |
---|---|---|
committer | Ian Stokes <ian.stokes@intel.com> | 2017-12-08 21:42:54 +0000 |
commit | d1ce9c2033fcbd4ee73c4b22abb6cf11db968bd2 (patch) | |
tree | 85c535d7e3f6676798e86c6ef0376c1f8bab0c1e /lib | |
parent | 8368866efbc8c0a1e5bbb7538e87128b452386cc (diff) | |
download | openvswitch-d1ce9c2033fcbd4ee73c4b22abb6cf11db968bd2.tar.gz |
dpif-netdev: Fix memory leak
Valgrind complains in test 1019 (dpctl - add-if set-if del-if):
4,850,896 (4,850,240 direct, 656 indirect) bytes in 1 blocks are
definitely lost in loss record 364 of 364
by 0x517062: xcalloc (util.c:103)
by 0x46CBBC: dp_netdev_set_nonpmd (dpif-netdev.c:4498)
by 0x46CBBC: create_dp_netdev (dpif-netdev.c:1299)
by 0x46CBBC: dpif_netdev_open (dpif-netdev.c:1337)
by 0x472CB0: do_open (dpif.c:350)
by 0x472E6F: dpif_create (dpif.c:404)
by 0x472E6F: dpif_create_and_open (dpif.c:417)
by 0x430EBC: open_dpif_backer (ofproto-dpif.c:727)
by 0x430EBC: construct (ofproto-dpif.c:1411)
by 0x41B714: ofproto_create (ofproto.c:539)
by 0x40C84E: bridge_reconfigure (bridge.c:647)
by 0x4104C5: bridge_run (bridge.c:2998)
by 0x406FA4: main (ovs-vswitchd.c:119)
The reference count wasn't released at this earlier return.
This fix passes the test 'make check'.
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpif-netdev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index bd38870f0..4e5bdbebb 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -2925,6 +2925,9 @@ dpif_netdev_execute(struct dpif *dpif, struct dpif_execute *execute) /* If this is part of a probe, Drop the packet, since executing * the action may actually cause spurious packets be sent into * the network. */ + if (pmd->core_id == NON_PMD_CORE_ID) { + dp_netdev_pmd_unref(pmd); + } return 0; } |