Skip to content

Commit

Permalink
Merge pull request #2704 from RossBrunton/ross/coverityfix
Browse files Browse the repository at this point in the history
[NFC] Small refactor for MsanInterceptor::allocateMemory
  • Loading branch information
RossBrunton authored Feb 14, 2025
2 parents 2a499d7 + a4077b0 commit 70795bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/loader/layers/sanitizer/msan/msan_interceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ ur_result_t MsanInterceptor::allocateMemory(ur_context_handle_t Context,
void **ResultPtr) {

auto ContextInfo = getContextInfo(Context);
std::shared_ptr<DeviceInfo> DeviceInfo =
Device ? getDeviceInfo(Device) : nullptr;

void *Allocated = nullptr;

Expand All @@ -75,7 +73,9 @@ ur_result_t MsanInterceptor::allocateMemory(ur_context_handle_t Context,
if (Type != AllocType::DEVICE_USM) {
return UR_RESULT_SUCCESS;
}

assert(Device);
std::shared_ptr<DeviceInfo> DeviceInfo = getDeviceInfo(Device);

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

0 comments on commit 70795bb

Please sign in to comment.