diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 2a55c9ad8..07dd6a764 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -772,6 +772,10 @@ associate_workers_with_ns(void) count = g_num_namespaces > g_num_workers ? g_num_namespaces : g_num_workers; for (i = 0; i < count; i++) { + if (entry == NULL) { + break; + } + ns_ctx = malloc(sizeof(struct ns_worker_ctx)); if (!ns_ctx) { return -1;