File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1071,9 +1071,12 @@ umf_result_t umfLevelZeroMemoryProviderResidentDeviceChange(
10711071 }
10721072 LOG_DEBUG ("enlarging resident devices array from %u to %u" ,
10731073 ze_provider -> resident_device_capacity , new_capacity );
1074- memcpy (new_handles , ze_provider -> resident_device_handles ,
1075- sizeof (ze_device_handle_t ) *
1076- ze_provider -> resident_device_count );
1074+ if (ze_provider -> resident_device_count > 0 ) {
1075+ ASSERT (ze_provider -> resident_device_handles != NULL );
1076+ memcpy (new_handles , ze_provider -> resident_device_handles ,
1077+ sizeof (ze_device_handle_t ) *
1078+ ze_provider -> resident_device_count );
1079+ }
10771080 umf_ba_global_free (ze_provider -> resident_device_handles );
10781081 ze_provider -> resident_device_handles = new_handles ;
10791082 ze_provider -> resident_device_capacity = new_capacity ;
You can’t perform that action at this time.
0 commit comments