diff --git a/ompi/win/win.h b/ompi/win/win.h index ab4af8fc43e..bd49bb69279 100644 --- a/ompi/win/win.h +++ b/ompi/win/win.h @@ -162,7 +162,7 @@ static inline int ompi_win_invalid(ompi_win_t *win) { } static inline int ompi_win_peer_invalid(ompi_win_t *win, int peer) { - if (win->w_group->grp_proc_count <= peer) return true; + if (win->w_group->grp_proc_count <= peer || peer < 0) return true; return false; }