File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
source/loader/layers/sanitizer/asan Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,15 @@ ur_result_t ShadowMemoryGPU::Setup() {
108108 // TODO: Protect Bad Zone
109109 auto Result = getContext ()->urDdiTable .VirtualMem .pfnReserve (
110110 Context, nullptr , ShadowSize, (void **)&ShadowBegin);
111- if (Result == UR_RESULT_SUCCESS) {
112- ShadowEnd = ShadowBegin + ShadowSize;
113- // Retain the context which reserves shadow memory
114- getContext ()->urDdiTable .Context .pfnRetain (Context);
111+ if (Result != UR_RESULT_SUCCESS) {
112+ getContext ()->logger .error (
113+ " Shadow memory reserved failed with size {}: {}" ,
114+ (void *)ShadowSize, Result);
115+ return Result;
115116 }
117+ ShadowEnd = ShadowBegin + ShadowSize;
118+ // Retain the context which reserves shadow memory
119+ getContext ()->urDdiTable .Context .pfnRetain (Context);
116120
117121 // Set shadow memory for null pointer
118122 // For GPU, wu use up to 1 page of shadow memory
You can’t perform that action at this time.
0 commit comments