Skip to content

Commit 5e2bc2c

Browse files
committed
btl/openib: fix coverity issue
CID 1269821 Dereference null return value (NULL_RETURNS) This is another false positive that can be silenced by looping on opal_list_remove_first instead of using both opal_list_is_empty and opal_list_remove_first. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 65472a3 commit 5e2bc2c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

opal/mca/btl/openib/btl_openib_endpoint.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -613,13 +613,13 @@ void mca_btl_openib_endpoint_connected(mca_btl_openib_endpoint_t *endpoint)
613613
opal_progress_event_users_decrement();
614614

615615
if(MCA_BTL_XRC_ENABLED) {
616-
while(master && !opal_list_is_empty(&endpoint->ib_addr->pending_ep)) {
617-
ep_item = opal_list_remove_first(&endpoint->ib_addr->pending_ep);
618-
ep = (mca_btl_openib_endpoint_t *)ep_item;
619-
if (OPAL_SUCCESS !=
620-
opal_btl_openib_connect_base_start(endpoint->endpoint_local_cpc,
621-
ep)) {
622-
BTL_ERROR(("Failed to connect pending endpoint\n"));
616+
if (master) {
617+
while (NULL != (ep_item = opal_list_remove_first(&endpoint->ib_addr->pending_ep))) {
618+
ep = (mca_btl_openib_endpoint_t *)ep_item;
619+
if (OPAL_SUCCESS !=
620+
opal_btl_openib_connect_base_start(endpoint->endpoint_local_cpc, ep)) {
621+
BTL_ERROR(("Failed to connect pending endpoint\n"));
622+
}
623623
}
624624
}
625625
OPAL_THREAD_UNLOCK(&endpoint->ib_addr->addr_lock);

0 commit comments

Comments
 (0)