Skip to content

Commit 1bcbcd5

Browse files
authored
Merge pull request #11659 from amirshehataornl/11657
ofi: Fix Coverity warnings
2 parents bc2a691 + 47f18dc commit 1bcbcd5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,9 @@ static bool is_near(pmix_device_distance_t *distances,
651651
ret = sscanf(distances[i].uuid, "fab://%256s::%256s", lnguid, lsguid);
652652
if (ret != 2)
653653
continue;
654-
if (0 == strcasecmp(lnguid, nguid)) {
654+
if (nguid && (0 == strcasecmp(lnguid, nguid))) {
655655
return true;
656-
} else if (0 == strcasecmp(lsguid, sguid)) {
656+
} else if (sguid && (0 == strcasecmp(lsguid, sguid))) {
657657
return true;
658658
}
659659
}
@@ -789,7 +789,7 @@ struct fi_info *opal_common_ofi_select_provider(struct fi_info *provider_list,
789789
struct fi_pci_attr pci;
790790
int num_distances = 0;
791791
#endif
792-
bool near;
792+
bool near = false;
793793
int ret;
794794
unsigned int num_provider = 0, provider_limit = 0;
795795
bool provider_found = false;

0 commit comments

Comments
 (0)