From d317ce036714c8468756638ef78a1823ea86e456 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 7 Oct 2009 20:01:50 +0000 Subject: [PATCH] Fix CID 1381: don't bother checking for (NULL == p); it's overkill. posix_memalign() will either return 0 or not, indicating success. And if posix_memalign() fails, it's not always going to be due to out-of-memory -- just return ERR_IN_ERRNO. This commit was SVN r22070. --- opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c index 5527444760..07c5338cb8 100644 --- a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c +++ b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c @@ -118,8 +118,8 @@ static int ptmalloc2_open(void) /* Double check for posix_memalign, too */ if (opal_memory_ptmalloc2_memalign_invoked) { opal_memory_ptmalloc2_memalign_invoked = false; - if (0 != posix_memalign(&p, sizeof(void*), 1024 * 1024) || NULL == p) { - return OPAL_ERR_OUT_OF_RESOURCE; + if (0 != posix_memalign(&p, sizeof(void*), 1024 * 1024)) { + return OPAL_ERR_IN_ERRNO; } free(p); }