SWDEV-450361 - Add nullptr validation for waitStream

- Application is passing null for parameter stream in API hipStreamWaitEvent
- When event stream isn't capturing and event is not recorded, causes segfault because we are accessing deviceId() from waitStream

Change-Id: I8b87ffd6f234677f68b66dcb7ef44b2ff04a7c91
Esse commit está contido em:
Rakesh Roy
2024-04-01 12:50:48 +05:30
commit de Rakesh Roy
commit 880f1f0049
+1 -1
Ver Arquivo
@@ -463,7 +463,7 @@ hipError_t hipStreamWaitEvent_common(hipStream_t stream, hipEvent_t event, unsig
// If stream is capturing but event is not recorded on event's stream.
return hipErrorStreamCaptureIsolation;
}
if (eventStream->DeviceId() == waitStream->DeviceId()) {
if ((waitStream != nullptr) && (eventStream->DeviceId() == waitStream->DeviceId())) {
eventStream->GetDevice()->AddSafeStream(eventStream, waitStream);
}
}