summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2018-10-28 01:08:45 +0000
committerThomas Monjalon <thomas@monjalon.net>2018-11-06 01:14:15 +0100
commitc8b506e4b661c23264debc66f52c7270f903a00e (patch)
treefc213cd5e8ee096ca1d50d2a62d8586d7d0d7977
parent9eb06884120091a21fdfc35850167f6245c2109e (diff)
downloaddpdk-c8b506e4b661c23264debc66f52c7270f903a00e.zip
dpdk-c8b506e4b661c23264debc66f52c7270f903a00e.tar.gz
dpdk-c8b506e4b661c23264debc66f52c7270f903a00e.tar.xz
service: fix possible null access
Fixes: 21698354c832 ("service: introduce service cores concept") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
-rw-r--r--lib/librte_eal/common/rte_service.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 8767c72..0f3695c 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -795,6 +795,9 @@ rte_service_dump_one(FILE *f, struct rte_service_spec_impl *s,
return;
}
+ if (f == NULL)
+ return;
+
fprintf(f, " %s: stats %d\tcalls %"PRIu64"\tcycles %"
PRIu64"\tavg: %"PRIu64"\n",
s->spec.name, service_stats_enabled(s), s->calls,