SM/MM: fix coverity issues.
SM/MM: fix coverity issues.

solves #424

shssf/ucx,abouteiller/ucx,shssf/ucx,shssf/ucx,sergsagal1/ucx_rocm,manjugv/ucx,abouteiller/ucx,sergsagal1/ucx_rocm,abouteiller/ucx,manjugv/ucx,manjugv/ucx,sergsagal1/ucx_rocm,abouteiller/ucx