Skip to content

Commit d951055

Browse files
authored
Merge pull request #3324 from hjelmn/v3.x_osc_pt2pt
osc/pt2pt: fix infinite frag allocation loop
2 parents d97c81f + a889253 commit d951055

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt_frag.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
4-
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
4+
* Copyright (c) 2014-2017 Los Alamos National Security, LLC. All rights
55
* reserved.
66
* $COPYRIGHT$
77
*
@@ -172,8 +172,12 @@ static inline int ompi_osc_pt2pt_frag_alloc (ompi_osc_pt2pt_module_t *module, in
172172
{
173173
int ret;
174174

175+
if (request_len > mca_osc_pt2pt_component.buffer_size) {
176+
return OMPI_ERR_OUT_OF_RESOURCE;
177+
}
178+
175179
do {
176-
ret = ompi_osc_pt2pt_frag_alloc (module, target, request_len , buffer, ptr, long_send, buffered);
180+
ret = _ompi_osc_pt2pt_frag_alloc (module, target, request_len , buffer, ptr, long_send, buffered);
177181
if (OPAL_LIKELY(OMPI_SUCCESS == ret || OMPI_ERR_OUT_OF_RESOURCE != ret)) {
178182
break;
179183
}

0 commit comments

Comments
 (0)