@@ -639,7 +639,6 @@ int ompi_osc_ucx_win_attach(struct ompi_win_t *win, void *base, size_t len) {
639
639
int ompi_osc_ucx_win_detach (struct ompi_win_t * win , const void * base ) {
640
640
ompi_osc_ucx_module_t * module = (ompi_osc_ucx_module_t * ) win -> w_osc_module ;
641
641
int insert , contain ;
642
- int ret = OMPI_SUCCESS ;
643
642
644
643
assert (module -> state .dynamic_win_count > 0 );
645
644
@@ -655,7 +654,7 @@ int ompi_osc_ucx_win_detach(struct ompi_win_t *win, const void *base) {
655
654
656
655
module -> local_dynamic_win_info [contain ].refcnt -- ;
657
656
if (module -> local_dynamic_win_info [contain ].refcnt == 0 ) {
658
- ret = opal_common_ucx_wpmem_free (module -> local_dynamic_win_info [contain ].mem );
657
+ opal_common_ucx_wpmem_free (module -> local_dynamic_win_info [contain ].mem );
659
658
memmove ((void * )& (module -> local_dynamic_win_info [contain ]),
660
659
(void * )& (module -> local_dynamic_win_info [contain + 1 ]),
661
660
(OMPI_OSC_UCX_ATTACH_MAX - (contain + 1 )) * sizeof (ompi_osc_local_dynamic_win_info_t ));
@@ -666,7 +665,7 @@ int ompi_osc_ucx_win_detach(struct ompi_win_t *win, const void *base) {
666
665
module -> state .dynamic_win_count -- ;
667
666
}
668
667
669
- return ret ;
668
+ return OMPI_SUCCESS ;
670
669
}
671
670
672
671
int ompi_osc_ucx_free (struct ompi_win_t * win ) {
@@ -691,19 +690,13 @@ int ompi_osc_ucx_free(struct ompi_win_t *win) {
691
690
free (module -> addrs );
692
691
free (module -> state_addrs );
693
692
694
- ret = opal_common_ucx_wpmem_free (module -> state_mem );
695
- if (ret != OMPI_SUCCESS ) {
696
- return ret ;
697
- }
698
-
699
- ret = opal_common_ucx_wpmem_free (module -> mem );
700
- if (ret != OMPI_SUCCESS ) {
701
- return ret ;
702
- }
693
+ opal_common_ucx_wpmem_free (module -> state_mem );
694
+ opal_common_ucx_wpmem_free (module -> mem );
703
695
704
696
opal_common_ucx_wpctx_release (module -> ctx );
705
697
706
- if (module -> disp_units ) free (module -> disp_units );
698
+ if (module -> disp_units )
699
+ free (module -> disp_units );
707
700
ompi_comm_free (& module -> comm );
708
701
709
702
free (module );
0 commit comments