rocr: uninitialized pointer read in InitScratchPool
Initialized 'scratch_base' as a nullptr to avoid uninitialized read in hsaKmtAllocMemory() Change-Id: I3b0e67f3fd3b591e1d21d691f0777b1d1a059b73 Signed-off-by: Apurv Mishra <apurv.mishra@amd.com>
This commit is contained in:
@@ -555,7 +555,7 @@ void GpuAgent::InitScratchPool() {
|
||||
}
|
||||
#endif
|
||||
|
||||
void* scratch_base;
|
||||
void* scratch_base = nullptr;
|
||||
HSAKMT_STATUS err =
|
||||
hsaKmtAllocMemory(node_id(), max_scratch_len, flags, &scratch_base);
|
||||
assert(err == HSAKMT_STATUS_SUCCESS && "hsaKmtAllocMemory(Scratch) failed");
|
||||
|
||||
Reference in New Issue
Block a user