Commit 3da8af26 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Gerrit Code Review
Browse files

nvme/perf: don't crash if no namespaces are usable



Change-Id: I8ecf5b632c2d3bf94f913fb5e0aa5b4ff2e68c40
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent b7b8dea6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;