Skip to content

Commit 8151ca1

Browse files
committed
fix return of gpu setup
1 parent bd6e8c9 commit 8151ca1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

source/loader/layers/sanitizer/asan/asan_shadow.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)