SWDEV-269246 - Fixed null-case logic for hipCtxPopCurrent

Change-Id: Ic173980caccde8afee85a75c55a5d536f421549e


[ROCm/clr commit: 5c2eb09624]
This commit is contained in:
Arya.Rafii
2021-02-17 14:08:14 -05:00
committed by Arya Rafii
parent 9374c2bb93
commit 64f7d5b430
+3 -5
View File
@@ -214,12 +214,10 @@ hipError_t hipCtxPopCurrent(hipCtx_t* ctx) {
HIP_INIT_API(hipCtxPopCurrent, ctx);
hip::Device** dev = reinterpret_cast<hip::Device**>(ctx);
if (dev == nullptr) {
HIP_RETURN(hipErrorInvalidContext);
}
if (!g_ctxtStack.empty()) {
*dev = g_ctxtStack.top();
if (dev != nullptr) {
*dev = g_ctxtStack.top();
}
g_ctxtStack.pop();
} else {
DevLogError("Context Stack empty \n");