service: fix possible null access
authorFerruh Yigit <ferruh.yigit@intel.com>
Sun, 28 Oct 2018 01:08:45 +0000 (01:08 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 6 Nov 2018 00:14:15 +0000 (01:14 +0100)
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>
lib/librte_eal/common/rte_service.c

index 8767c72..0f3695c 100644 (file)
@@ -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,