diff mbox series

[ovs-dev,1/4] netdev-dpdk: Fix mp_name leak on snprintf failure.

Message ID 1509367961-7172-2-git-send-email-i.maximets@samsung.com
State Accepted
Headers show
Series netdev-dpdk: mempool management: Leaks & Refactoring. | expand

Commit Message

Ilya Maximets Oct. 30, 2017, 12:52 p.m. UTC
CC: Robert Wojciechowicz <robertx.wojciechowicz@intel.com>
CC: Antonio Fischetti <antonio.fischetti@intel.com>
Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
Fixes: 65056fd79694 ("netdev-dpdk: manage failure in mempool name creation.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 lib/netdev-dpdk.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ben Pfaff Oct. 30, 2017, 11 p.m. UTC | #1
On Mon, Oct 30, 2017 at 03:52:38PM +0300, Ilya Maximets wrote:
> CC: Robert Wojciechowicz <robertx.wojciechowicz@intel.com>
> CC: Antonio Fischetti <antonio.fischetti@intel.com>
> Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
> Fixes: 65056fd79694 ("netdev-dpdk: manage failure in mempool name creation.")
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>

Thanks, applied to master.  Let me know if this needs backporting.
Ben Pfaff Oct. 30, 2017, 11:02 p.m. UTC | #2
On Mon, Oct 30, 2017 at 04:00:20PM -0700, Ben Pfaff wrote:
> On Mon, Oct 30, 2017 at 03:52:38PM +0300, Ilya Maximets wrote:
> > CC: Robert Wojciechowicz <robertx.wojciechowicz@intel.com>
> > CC: Antonio Fischetti <antonio.fischetti@intel.com>
> > Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
> > Fixes: 65056fd79694 ("netdev-dpdk: manage failure in mempool name creation.")
> > Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> 
> Thanks, applied to master.  Let me know if this needs backporting.

This patch was obviously correct to me, but I don't feel qualified to
review the remainder of the series, so I will leave that to Ian.
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 82652f0..1e9d78f 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -505,6 +505,7 @@  dpdk_mp_name(struct dpdk_mp *dmp)
         VLOG_DBG("snprintf returned %d. Failed to generate a mempool "
             "name for \"%s\". Hash:0x%x, mtu:%d, mbufs:%u.",
             ret, dmp->if_name, h, dmp->mtu, dmp->n_mbufs);
+        free(mp_name);
         return NULL;
     }
     return mp_name;