Skip to content

Commit

Permalink
fabtests: Resolve uninitialized variable errors
Browse files Browse the repository at this point in the history
Coverity flagged some issues with uninitialized scalar variables
in different places. The fix is to initialize msg.data, msg.ignore,
buf and char variables.

Signed-off-by: Juee Himalbhai Desai <[email protected]>
  • Loading branch information
Juee14Desai authored and j-xiong committed Feb 21, 2024
1 parent 23e4707 commit 3a3f35f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -2914,7 +2914,7 @@ void eq_readerr(struct fid_eq *eq, const char *eq_str)

int ft_sync()
{
char buf;
char buf = 'a';
int ret;

if (opts.dst_addr) {
Expand Down
2 changes: 2 additions & 0 deletions fabtests/functional/rdm_deferred_wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static void format_simple_msg_tagged(struct fi_msg_tagged *msg, struct iovec *io
msg->addr = remote_fi_addr;
msg->data = 0;
msg->tag = tag;
msg->ignore = 0;

iov->iov_base = src;
iov->iov_len = size;
Expand All @@ -89,6 +90,7 @@ static void format_simple_msg_rma(struct fi_msg_rma *msg, struct iovec *iov,
msg->iov_count = 1;
msg->addr = remote_fi_addr;
msg->rma_iov_count = 1;
msg->data = 0;

iov->iov_base = src;
iov->iov_len = size;
Expand Down
2 changes: 1 addition & 1 deletion fabtests/multinode/src/harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int pm_allgather(void *my_item, void *items, int item_size)

void pm_barrier(void)
{
char ch;
char ch = 'a';
char *chs = alloca(pm_job.num_ranks);

pm_allgather(&ch, chs, 1);
Expand Down

0 comments on commit 3a3f35f

Please sign in to comment.