Skip to content

Commit be915ca

Browse files
hoopoepgjanjust
authored andcommitted
OSC/UCX: suppressed some coverity issues
- suppressed reported coverity issues - suppressed compiler warnings Signed-off-by: Sergey Oblomov <hoopoepg@gmail.com>
1 parent 4dae142 commit be915ca

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

ompi/mca/osc/ucx/osc_ucx_comm.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,14 @@ static inline int get_dynamic_win_info(uint64_t remote_addr,
269269
uint64_t win_count;
270270
int insert = -1;
271271
int ret;
272+
int ret_unlock;
272273

273274
/* We need to lock dyn-lock even if the process has an exclusive lock.
274275
* Remote process protects its window attach/detach operations with a
275276
* dynamic lock */
276277
ret = ompi_osc_ucx_dynamic_lock(module, target);
277278
if (ret != OPAL_SUCCESS) {
278-
ret = OMPI_ERROR;
279-
goto cleanup;
279+
return OMPI_ERROR;
280280
}
281281

282282
temp_buf = calloc(remote_state_len, 1);
@@ -361,9 +361,9 @@ static inline int get_dynamic_win_info(uint64_t remote_addr,
361361
free(temp_buf);
362362

363363
/* unlock the dynamic lock */
364-
ompi_osc_ucx_dynamic_unlock(module, target);
365-
366-
return ret;
364+
ret_unlock = ompi_osc_ucx_dynamic_unlock(module, target);
365+
/* ignore unlock result in case of error */
366+
return (OPAL_SUCCESS != ret) ? ret : ret_unlock;
367367
}
368368

369369
static inline
@@ -1615,7 +1615,7 @@ void ompi_osc_ucx_req_completion(void *request) {
16151615
assert(req->phase != ACC_INIT);
16161616
void *free_addr = NULL;
16171617
bool release_lock = false;
1618-
ptrdiff_t temp_lb, temp_extent;
1618+
ptrdiff_t temp_extent, temp_lb;
16191619
const void *origin_addr = req->origin_addr;
16201620
int origin_count = req->origin_count;
16211621
struct ompi_datatype_t *origin_dt = req->origin_dt;
@@ -1786,7 +1786,7 @@ void ompi_osc_ucx_req_completion(void *request) {
17861786
module->state_mem->skip_periodic_flush = false;
17871787
}
17881788
}
1789+
assert(module->ctx->num_incomplete_req_ops > 0);
17891790
OSC_UCX_DECREMENT_OUTSTANDING_NB_OPS(module);
17901791
ompi_request_complete(&(ucx_req->super.super), true);
1791-
assert(module->ctx->num_incomplete_req_ops >= 0);
17921792
}

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,9 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in
784784
case MPI_WIN_FLAVOR_SHARED:
785785
mem_type = OPAL_COMMON_UCX_MEM_MAP;
786786
break;
787+
default:
788+
ret = OMPI_ERR_BAD_PARAM;
789+
goto error;
787790
}
788791
ret = opal_common_ucx_wpmem_create(module->ctx, mem_base, module->size,
789792
mem_type, &exchange_len_info,

opal/mca/common/ucx/common_ucx_wpool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ OPAL_DECLSPEC int opal_common_ucx_wpool_init(opal_common_ucx_wpool_t *wpool)
198198
OBJ_DESTRUCT(&wpool->idle_workers);
199199
OBJ_DESTRUCT(&wpool->active_workers);
200200
ucp_cleanup(wpool->ucp_ctx);
201-
err_ucp_init:
202201
return rc;
203202
}
204203

0 commit comments

Comments
 (0)