diff --git a/src/network/linkers_socket.cpp b/src/network/linkers_socket.cpp index 5b4b86ce67f8..8de48f3d0ae6 100644 --- a/src/network/linkers_socket.cpp +++ b/src/network/linkers_socket.cpp @@ -157,7 +157,7 @@ void Linkers::ListenThread(int incoming_cnt) { } int* ptr_in_rank = reinterpret_cast(buffer); int in_rank = *ptr_in_rank; - if (in_rank < 0 && in_rank >= num_machines_) { + if (in_rank < 0 || in_rank >= num_machines_) { Log::Fatal("Invalid rank %d found during initialization of linkers. The world size is %d", in_rank, num_machines_); } // add new socket