[dpdk-stable] patch 'mempool: fix leak when no objects are populated' has been queued to stable release 18.02.2
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Apr 30 16:41:38 CEST 2018
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a9640338bdc7ef5fc85d445d0b99b562006beb6b Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko at solarflare.com>
Date: Mon, 16 Apr 2018 14:24:30 +0100
Subject: [PATCH] mempool: fix leak when no objects are populated
[ upstream commit 25e6755056eaba45921b898b9986af68277ac6ac ]
Fixes: 84121f197187 ("mempool: store memory chunks in a list")
Suggested-by: Olivier Matz <olivier.matz at 6wind.com>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
lib/librte_mempool/rte_mempool.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 54f7f4ba4..80bf941c9 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -408,12 +408,18 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
}
/* not enough room to store one object */
- if (i == 0)
- return -EINVAL;
+ if (i == 0) {
+ ret = -EINVAL;
+ goto fail;
+ }
STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next);
mp->nb_mem_chunks++;
return i;
+
+fail:
+ rte_free(memhdr);
+ return ret;
}
int
--
2.14.2
More information about the stable
mailing list