mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
netdev-dpdk: Fix dpdk_mp leak in case of EEXIST.
In case of EEXIST, 'dpdk_mp_create()' will allocate yet another 'struct dpdk_mp' with same 'mp' pointer inside. We need to free this structure to avoid the leak. CC: Robert Wojciechowicz <robertx.wojciechowicz@intel.com> CC: Antonio Fischetti <antonio.fischetti@intel.com> Fixes:d555d9bded
("netdev-dpdk: Create separate memory pool for each port.") Fixes:b6b26021d2
("netdev-dpdk: fix management of pre-existing mempools.") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
This commit is contained in:
committed by
Ian Stokes
parent
7ee94cbac8
commit
173ef76bbf
@@ -659,6 +659,12 @@ netdev_dpdk_mempool_configure(struct netdev_dpdk *dev)
|
||||
* Update dev with the new values. */
|
||||
dev->mtu = dev->requested_mtu;
|
||||
dev->max_packet_len = MTU_TO_FRAME_LEN(dev->mtu);
|
||||
/* 'mp' should contain pointer to the mempool already owned by netdev.
|
||||
* Otherwise something went completely wrong. */
|
||||
ovs_assert(dev->dpdk_mp);
|
||||
ovs_assert(dev->dpdk_mp->mp == mp->mp);
|
||||
/* Free the returned struct dpdk_mp because it will not be used. */
|
||||
rte_free(mp);
|
||||
return EEXIST;
|
||||
} else {
|
||||
/* A new mempool was created, release the previous one. */
|
||||
|
Reference in New Issue
Block a user