From 2a4568d416a1cce9f8f41b51371818efc8e88420 Mon Sep 17 00:00:00 2001 From: agodavar Date: Tue, 29 Dec 2020 05:42:54 -0500 Subject: [PATCH] SWDEV-266089: hipStreamAddCallback argument validation Change-Id: I3e61006796e88b4e2ba029118c95f3499959257b --- rocclr/hip_stream.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rocclr/hip_stream.cpp b/rocclr/hip_stream.cpp index 24312f018d..16a64dc2a9 100755 --- a/rocclr/hip_stream.cpp +++ b/rocclr/hip_stream.cpp @@ -346,7 +346,10 @@ hipError_t hipStreamQuery(hipStream_t stream) { hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData, unsigned int flags) { HIP_INIT_API(hipStreamAddCallback, stream, callback, userData, flags); - + //flags - Reserved for future use, must be 0 + if (callback == nullptr || flags != 0) { + HIP_RETURN(hipErrorInvalidValue); + } amd::HostQueue* hostQueue = hip::getQueue(stream); amd::Command* command = hostQueue->getLastQueuedCommand(true); if (command == nullptr) {