@@ -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
369369static 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}
0 commit comments