Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit f56e7eb

Browse files
committed
CSCuv67889: usnic: fix an error corner case
Ensure that we have non-NULL on all levels of pointers, which will save us if there are exitable errors very early during component / module initialization. (cherry picked from commit open-mpi/ompi@b5c37db)
1 parent 8b2ba0f commit f56e7eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

opal/mca/btl/usnic/btl_usnic_util.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2013-2015 Cisco Systems, Inc. All rights reserved.
33
* $COPYRIGHT$
44
*
55
* Additional copyrights may follow
@@ -25,7 +25,9 @@ void opal_btl_usnic_exit(opal_btl_usnic_module_t *module)
2525
if (NULL == module) {
2626
/* Find the first module with an error callback */
2727
for (int i = 0; i < mca_btl_usnic_component.num_modules; ++i) {
28-
if (NULL != mca_btl_usnic_component.usnic_active_modules[i]->pml_error_callback) {
28+
if (NULL != mca_btl_usnic_component.usnic_active_modules &&
29+
NULL != mca_btl_usnic_component.usnic_active_modules[i] &&
30+
NULL != mca_btl_usnic_component.usnic_active_modules[i]->pml_error_callback) {
2931
module = mca_btl_usnic_component.usnic_active_modules[i];
3032
break;
3133
}

0 commit comments

Comments
 (0)