Skip to content

Commit 09ee70e

Browse files
committed
fix devdax_allocation_merge arg checks
1 parent 05ddc12 commit 09ee70e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/provider/provider_devdax_memory.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,9 @@ static umf_result_t devdax_allocation_split(void *provider, void *ptr,
360360

361361
static umf_result_t devdax_allocation_merge(void *provider, void *lowPtr,
362362
void *highPtr, size_t totalSize) {
363-
(void)provider;
364-
365-
if ((uintptr_t)highPtr <= (uintptr_t)lowPtr) {
366-
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
367-
}
368-
369-
if ((uintptr_t)highPtr - (uintptr_t)lowPtr <= totalSize) {
363+
if (provider == NULL || lowPtr == NULL || highPtr == NULL ||
364+
((uintptr_t)highPtr <= (uintptr_t)lowPtr) ||
365+
((uintptr_t)highPtr - (uintptr_t)lowPtr >= totalSize)) {
370366
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
371367
}
372368

0 commit comments

Comments
 (0)