SWDEV-330240 - HLK pnp with IO stress test fail

This code change is to improve error handling.
This code change does not fix issue itself.
Before this code change, hostcallBuffer_ point is initialized in the end of
create() function. If create function fails and returns early,
hostcallBuffer_ point is not initialized. This non-initialized point can
cause access violation when object is destructed.

This code change put the initialization of the pointer in the constructor.

Change-Id: I7fb6e764eb0547196dca03db237e49d3ff0fd06a


[ROCm/clr commit: 5528812aa9]
Tá an tiomantas seo le fáil i:
Alex Xie údaraithe agus AlexBin Xie tiomanta 2022-04-19 11:04:26 -04:00
1 tuismitheoir 197b30f798
tiomantas d7bac9b567
1 comhad athraithe
+3 -3
+3 -3
Féach ar an gComhad
@@ -878,6 +878,9 @@ VirtualGPU::VirtualGPU(Device& device)
queues_[MainEngine] = nullptr;
queues_[SdmaEngine] = nullptr;
// The hostcall buffer for this vqueue is initialized on demand.
hostcallBuffer_ = nullptr;
}
bool VirtualGPU::create(bool profiling, uint deviceQueueSize, uint rtCUs,
@@ -1035,9 +1038,6 @@ bool VirtualGPU::create(bool profiling, uint deviceQueueSize, uint rtCUs,
&dbg_vmid);
}
// The hostcall buffer for this vqueue is initialized on demand.
hostcallBuffer_ = nullptr;
return true;
}