Skip to content

Commit d53a23f

Browse files
committed
WIP 2025-09-12 pią 12:12
1 parent a8baf31 commit d53a23f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/provider/provider_level_zero.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,17 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetResidentDevices(
361361
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
362362
}
363363

364-
if (residentDevicesCount && !residentDevicesIndices) {
364+
if (residentDevicesCount > 0 && residentDevicesIndices == NULL) {
365365
LOG_ERR("Resident devices indices array is NULL, but "
366366
"residentDevicesCount is not zero");
367367
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
368368
}
369369

370+
if (deviceCount > 0 && hDevices == NULL) {
371+
LOG_ERR("All devices array is NULL, but deviceCount is not zero");
372+
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
373+
}
374+
370375
hParams->device_handles = hDevices;
371376
hParams->device_count = deviceCount;
372377
hParams->resident_device_indices = residentDevicesIndices;

0 commit comments

Comments
 (0)