-
Notifications
You must be signed in to change notification settings - Fork 936
SPML/UCX: fixed coverity issues #7332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPML/UCX: fixed coverity issues #7332
Conversation
dmitrygx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git commit -s
oshmem/mca/spml/ucx/spml_ucx.c
Outdated
| opal_progress_register(spml_ucx_default_progress); | ||
|
|
||
| mca_spml_ucx.remote_addrs_tbl = (char ***)calloc(mca_spml_ucx.ucp_workers, sizeof(char ***)); | ||
| mca_spml_ucx.remote_addrs_tbl = (char ***)calloc(mca_spml_ucx.ucp_workers, sizeof(void*)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe sizeof(*mca_spml_ucx.remote_addrs_tbl)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good idea
oshmem/mca/spml/ucx/spml_ucx.c
Outdated
| for (w = 0; w < ucp_workers; w++) { | ||
| mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(char **)); | ||
| memset(mca_spml_ucx.remote_addrs_tbl[w], 0, nprocs * sizeof(char **)); | ||
| mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(void*)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe sizeof(*mca_spml_ucx.remote_addrs_tbl[w])?
oshmem/mca/spml/ucx/spml_ucx.c
Outdated
| mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(char **)); | ||
| memset(mca_spml_ucx.remote_addrs_tbl[w], 0, nprocs * sizeof(char **)); | ||
| mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(void*)); | ||
| memset(mca_spml_ucx.remote_addrs_tbl[w], 0, nprocs * sizeof(void*)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memset() isn't needed here, since we use calloc() for memory allocation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
5f15c1b to
9b16cac
Compare
hoopoepg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git commit -s
forgot about this... fixed
- fixed sizeof(char***) by variable datatype - fixed resorce leak in proc_add Signed-off-by: Sergey Oblomov <[email protected]>
9b16cac to
8543860
Compare
|
Thanks, @hoopoepg ! |
behaviour