Skip to content

Commit

Permalink
fix: ofiutils: always write num_prov_infos
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Sielicki committed Mar 21, 2024
1 parent 40abe7e commit b113aff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nccl_ofi_ofiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ int nccl_ofi_ofiutils_get_providers(const char *prov_include,

if (!providers)
goto error;
if (!num_prov_infos)
goto error;
*num_prov_infos = 0;

/* Pick a provider name to use. If there is a prov_include
* provided, use the first provider which matches the list,
Expand Down Expand Up @@ -201,7 +204,6 @@ int nccl_ofi_ofiutils_get_providers(const char *prov_include,
prov = providers;
providers = NULL;
last_prov = NULL;
*num_prov_infos = 0;
while (prov) {
struct fi_info *prov_next = prov->next;
prov->next = NULL;
Expand Down

0 comments on commit b113aff

Please sign in to comment.