The last mbuf allocated in bulk is never used and never freed.

Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate function")
Fixes: 561ddcf8d099 ("app/testpmd: allocate txonly segments per bulk")

Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com>
---
 app/test-pmd/txonly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index fa8e0c0..fdfca14 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -167,7 +167,7 @@
                nb_segs = tx_pkt_nb_segs;
 
        if (nb_segs > 1) {
-               if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, nb_segs))
+               if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, nb_segs - 1))
                        return false;
        }
 
-- 
1.8.3.1

Reply via email to