Skip to content

Commit

Permalink
fix: silence clangsa warnings on pointer mismatch
Browse files Browse the repository at this point in the history
match the sizeof(type) to the pointer type we're assigning to.
  • Loading branch information
aws-nslick committed Mar 11, 2024
1 parent d6814af commit 9b5f632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/nccl_ofi_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -6024,7 +6024,7 @@ int nccl_net_ofi_rdma_init(const char *provider_filter,
goto error;
}

base_devs = calloc(num_devs, sizeof(nccl_net_ofi_rdma_device_t *));
base_devs = calloc(num_devs, sizeof(nccl_net_ofi_device_t *));
if (!base_devs) {
NCCL_OFI_WARN("Unable to allocate "
"nccl_net_ofi_rdma_device_t pointer array");
Expand Down
2 changes: 1 addition & 1 deletion src/nccl_ofi_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ int nccl_net_ofi_sendrecv_init(const char *provider_filter,
goto exit;
}

base_devs = malloc(num_providers * sizeof(nccl_net_ofi_sendrecv_device_t *));
base_devs = malloc(num_providers * sizeof(nccl_net_ofi_device_t *));
if (!base_devs) {
NCCL_OFI_WARN("Unable to allocate "
"nccl_net_ofi_sendrecv_device_t pointer array");
Expand Down

0 comments on commit 9b5f632

Please sign in to comment.