From: Andrew Rybchenko Date: Wed, 8 May 2019 10:27:37 +0000 (+0100) Subject: app/testpmd: fix mbuf leak with multi-segment Tx X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b3711336280364172e48ccd38d965abfb854d7a9;p=dpdk.git app/testpmd: fix mbuf leak with multi-segment Tx 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 Reviewed-by: Ferruh Yigit --- diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index fa8e0c0d33..fdfca14cbd 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -167,7 +167,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, 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; }