From a900f9ac9a325b45ec7eae67314ca6e9feeb8c3f Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 3 Nov 2015 13:26:19 -0700 Subject: [PATCH] nvme/perf: check nvme_register_io_thread() status Do not continue running the thread work function if that thread could not get an I/O queue. Change-Id: I89033250bde0663f073ff35c76d1558d55b72ece Signed-off-by: Daniel Verkamp --- examples/nvme/perf/perf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 7447e21423..a5759441d7 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -426,7 +426,10 @@ work_fn(void *arg) printf("Starting thread on core %u\n", worker->lcore); - nvme_register_io_thread(); + if (nvme_register_io_thread() != 0) { + fprintf(stderr, "nvme_register_io_thread() failed on core %u\n", worker->lcore); + return -1; + } /* Submit initial I/O for each namespace. */ ns_ctx = worker->ns_ctx;