git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fdf20fa
)
mempool: avoid dump crash with null pointer
author
Keith Wiles
<keith.wiles@windriver.com>
Sun, 28 Sep 2014 05:28:44 +0000
(
05:28
+0000)
committer
Thomas Monjalon
<thomas.monjalon@6wind.com>
Thu, 27 Nov 2014 16:30:20 +0000
(17:30 +0100)
Check the FILE *f and rte_mempool *mp pointers for NULL.
Signed-off-by: Keith Wiles <keith.wiles@windriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
lib/librte_mempool/rte_mempool.c
patch
|
blob
|
history
diff --git
a/lib/librte_mempool/rte_mempool.c
b/lib/librte_mempool/rte_mempool.c
index
8f10be8
..
4cf6c25
100644
(file)
--- 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);