Skip to content

Commit 70795bb

Browse files
authored
Merge pull request #2704 from RossBrunton/ross/coverityfix
[NFC] Small refactor for MsanInterceptor::allocateMemory
2 parents 2a499d7 + a4077b0 commit 70795bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/loader/layers/sanitizer/msan/msan_interceptor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ ur_result_t MsanInterceptor::allocateMemory(ur_context_handle_t Context,
5151
void **ResultPtr) {
5252

5353
auto ContextInfo = getContextInfo(Context);
54-
std::shared_ptr<DeviceInfo> DeviceInfo =
55-
Device ? getDeviceInfo(Device) : nullptr;
5654

5755
void *Allocated = nullptr;
5856

@@ -75,7 +73,9 @@ ur_result_t MsanInterceptor::allocateMemory(ur_context_handle_t Context,
7573
if (Type != AllocType::DEVICE_USM) {
7674
return UR_RESULT_SUCCESS;
7775
}
76+
7877
assert(Device);
78+
std::shared_ptr<DeviceInfo> DeviceInfo = getDeviceInfo(Device);
7979

8080
auto AI = std::make_shared<MsanAllocInfo>(MsanAllocInfo{(uptr)Allocated,
8181
Size,

0 commit comments

Comments
 (0)