File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -689,7 +689,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
689689{
690690 sshmem_mkey_t * mkeys ;
691691 ucs_status_t status ;
692- spml_ucx_mkey_t * ucx_mkey ;
692+ spml_ucx_mkey_t * ucx_mkey = NULL ;
693693 size_t len ;
694694 ucp_mem_map_params_t mem_map_params ;
695695 uint32_t segno ;
@@ -740,7 +740,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
740740 status = ucp_rkey_pack (mca_spml_ucx .ucp_context , mem_h ,
741741 & mkeys [SPML_UCX_TRANSP_IDX ].u .data , & len );
742742 if (UCS_OK != status ) {
743- goto error_unmap ;
743+ goto error_out ;
744744 }
745745 if (len >= 0xffff ) {
746746 SPML_UCX_ERROR ("packed rkey is too long: %llu >= %d" ,
@@ -761,7 +761,9 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
761761 return mkeys ;
762762
763763error_unmap :
764- ucp_mem_unmap (mca_spml_ucx .ucp_context , ucx_mkey -> mem_h );
764+ if (NULL != ucx_mkey ) {
765+ ucp_mem_unmap (mca_spml_ucx .ucp_context , ucx_mkey -> mem_h );
766+ }
765767error_out :
766768 free (mkeys );
767769
You can’t perform that action at this time.
0 commit comments