1
1

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 <hjelmn@lanl.gov>
Этот коммит содержится в:
Nathan Hjelm 2015-05-29 08:44:03 -06:00
родитель 65472a383f
Коммит 5e2bc2c662

Просмотреть файл

@ -613,13 +613,13 @@ void mca_btl_openib_endpoint_connected(mca_btl_openib_endpoint_t *endpoint)
opal_progress_event_users_decrement();
if(MCA_BTL_XRC_ENABLED) {
while(master && !opal_list_is_empty(&endpoint->ib_addr->pending_ep)) {
ep_item = opal_list_remove_first(&endpoint->ib_addr->pending_ep);
ep = (mca_btl_openib_endpoint_t *)ep_item;
if (OPAL_SUCCESS !=
opal_btl_openib_connect_base_start(endpoint->endpoint_local_cpc,
ep)) {
BTL_ERROR(("Failed to connect pending endpoint\n"));
if (master) {
while (NULL != (ep_item = opal_list_remove_first(&endpoint->ib_addr->pending_ep))) {
ep = (mca_btl_openib_endpoint_t *)ep_item;
if (OPAL_SUCCESS !=
opal_btl_openib_connect_base_start(endpoint->endpoint_local_cpc, ep)) {
BTL_ERROR(("Failed to connect pending endpoint\n"));
}
}
}
OPAL_THREAD_UNLOCK(&endpoint->ib_addr->addr_lock);