Commit 2b0b705f authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

reactor: make sure socket_count isn't zero



Avoid division by zero in the event mempool cache size calculation.

Change-Id: Ic117ef2dc3a798fb0a57572f1178233e83e73849
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 31b81b0d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -599,6 +599,10 @@ spdk_reactors_init(const char *mask, unsigned int max_delay_us)
			socket_count++;
		}
	}
	if (socket_count == 0) {
		printf("No sockets occupied (internal error)\n");
		return -1;
	}

	for (i = 0; i < SPDK_MAX_SOCKET; i++) {
		if ((1ULL << i) & socket_mask) {