Skip to content

Commit cba18d1

Browse files
committed
Fix ulong number calculation in OS provider
fix off by 1 error which resulted in reading one too many longs from the nodemask.
1 parent 15634d0 commit cba18d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/provider/provider_os_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static umf_result_t nodemask_to_hwloc_nodeset(const unsigned long *nodemask,
111111

112112
unsigned bits_per_mask = sizeof(unsigned long) * 8;
113113
hwloc_bitmap_from_ulongs(
114-
*out_nodeset, (maxnode + bits_per_mask) / bits_per_mask, nodemask);
114+
*out_nodeset, (maxnode + bits_per_mask - 1) / bits_per_mask, nodemask);
115115

116116
return UMF_RESULT_SUCCESS;
117117
}

0 commit comments

Comments
 (0)