From d9debabdc3a0e489dabd64c91fe6b101cddffaa6 Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Fri, 26 Mar 2021 04:06:25 -0700 Subject: [PATCH] SWDEV-278873 - hipStreamCreate handle invalid flag value Change-Id: I05c0e0b76f7b09947e48d5b9f225af305bade27f --- hipamd/rocclr/hip_stream.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hipamd/rocclr/hip_stream.cpp b/hipamd/rocclr/hip_stream.cpp index 49475bca7d..322a5915a9 100755 --- a/hipamd/rocclr/hip_stream.cpp +++ b/hipamd/rocclr/hip_stream.cpp @@ -188,6 +188,9 @@ void CL_CALLBACK ihipStreamCallback(cl_event event, cl_int command_exec_status, static hipError_t ihipStreamCreate(hipStream_t* stream, unsigned int flags, hip::Stream::Priority priority, const std::vector& cuMask = {}) { + if (flags != hipStreamDefault && flags != hipStreamNonBlocking) { + return hipErrorInvalidValue; + } hip::Stream* hStream = new hip::Stream(hip::getCurrentDevice(), priority, flags, false, cuMask); if (hStream == nullptr || !hStream->Create()) {