From: Keith Wiles Date: Sun, 28 Sep 2014 05:28:44 +0000 (+0000) Subject: mempool: avoid dump crash with null pointer X-Git-Tag: spdx-start~10024 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1665d6310dbe461c8f886713dee76f769670f9e4;p=dpdk.git mempool: avoid dump crash with null pointer Check the FILE *f and rte_mempool *mp pointers for NULL. Signed-off-by: Keith Wiles Acked-by: Neil Horman --- diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 8f10be8b1c..4cf6c25b45 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -765,6 +765,9 @@ rte_mempool_dump(FILE *f, const struct rte_mempool *mp) unsigned common_count; unsigned cache_count; + RTE_VERIFY(f != NULL); + RTE_VERIFY(mp != NULL); + fprintf(f, "mempool <%s>@%p\n", mp->name, mp); fprintf(f, " flags=%x\n", mp->flags); fprintf(f, " ring=<%s>@%p\n", mp->ring->name, mp->ring);