Merge pull request #1466 from hjelmn/mpool_coverity
opal: fix various coverity errors
Этот коммит содержится в:
Коммит
40dbd7fe2d
@ -225,11 +225,7 @@ int opal_free_list_grow_st (opal_free_list_t* flist, size_t num_elements)
|
|||||||
flist->fl_rcache_reg_flags, MCA_RCACHE_ACCESS_ANY, ®);
|
flist->fl_rcache_reg_flags, MCA_RCACHE_ACCESS_ANY, ®);
|
||||||
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
|
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
|
||||||
free (alloc_ptr);
|
free (alloc_ptr);
|
||||||
if (flist->fl_mpool) {
|
|
||||||
flist->fl_mpool->mpool_free (flist->fl_mpool, payload_ptr);
|
flist->fl_mpool->mpool_free (flist->fl_mpool, payload_ptr);
|
||||||
} else {
|
|
||||||
free (payload_ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ static void mca_mpool_hugepage_find_hugepages (void) {
|
|||||||
page_size = info.f_bsize;
|
page_size = info.f_bsize;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
sscanf (tok, "pagesize=%lu", &page_size);
|
(void) sscanf (tok, "pagesize=%lu", &page_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == page_size) {
|
if (0 == page_size) {
|
||||||
@ -294,20 +294,23 @@ static int mca_mpool_hugepage_query (const char *hints, int *priority_out,
|
|||||||
my_priority = 0;
|
my_priority = 0;
|
||||||
opal_output_verbose (MCA_BASE_VERBOSE_INFO, opal_mpool_base_framework.framework_output,
|
opal_output_verbose (MCA_BASE_VERBOSE_INFO, opal_mpool_base_framework.framework_output,
|
||||||
"hugepage mpool does not match hint: %s=%s", key, value);
|
"hugepage mpool does not match hint: %s=%s", key, value);
|
||||||
|
opal_argv_free (hints_array);
|
||||||
return OPAL_ERR_NOT_FOUND;
|
return OPAL_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == strcasecmp ("page_size", key)) {
|
if (0 == strcasecmp ("page_size", key) && value) {
|
||||||
page_size = strtoul (value, &tmp, 0);
|
page_size = strtoul (value, &tmp, 0);
|
||||||
if (*tmp) {
|
if (*tmp) {
|
||||||
switch (*tmp) {
|
switch (*tmp) {
|
||||||
case 'g':
|
case 'g':
|
||||||
case 'G':
|
case 'G':
|
||||||
page_size *= 1024;
|
page_size *= 1024;
|
||||||
|
/* fall through */
|
||||||
case 'm':
|
case 'm':
|
||||||
case 'M':
|
case 'M':
|
||||||
page_size *= 1024;
|
page_size *= 1024;
|
||||||
|
/* fall through */
|
||||||
case 'k':
|
case 'k':
|
||||||
case 'K':
|
case 'K':
|
||||||
page_size *= 1024;
|
page_size *= 1024;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* Copyright (c) 2006 Voltaire. All rights reserved.
|
* Copyright (c) 2006 Voltaire. All rights reserved.
|
||||||
* Copyright (c) 2007 Mellanox Technologies. All rights reserved.
|
* Copyright (c) 2007 Mellanox Technologies. All rights reserved.
|
||||||
* Copyright (c) 2010 IBM Corporation. All rights reserved.
|
* Copyright (c) 2010 IBM Corporation. All rights reserved.
|
||||||
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
@ -159,8 +159,8 @@ void *mca_mpool_hugepage_seg_alloc (void *ctx, size_t *sizep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
base = mmap (NULL, size, PROT_READ | PROT_WRITE, flags | huge_page->mmap_flags, fd, 0);
|
base = mmap (NULL, size, PROT_READ | PROT_WRITE, flags | huge_page->mmap_flags, fd, 0);
|
||||||
if (path) {
|
|
||||||
close (fd);
|
close (fd);
|
||||||
|
if (path) {
|
||||||
unlink (path);
|
unlink (path);
|
||||||
free (path);
|
free (path);
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user