From f80bffb4ab4d807404dc62ac02f7df2b07914666 Mon Sep 17 00:00:00 2001 From: Rakesh Roy Date: Fri, 27 May 2022 18:40:59 +0530 Subject: [PATCH] SWDEV-337776 - Fix hipStreamEndCapture API - Return hipErrorInvalidValue when pGraph is nullptr Change-Id: I8846f4448eb15117f98421632885330f132c4fce [ROCm/clr commit: e2874d5e22ed3b65555a76050a378beaa38a885c] --- projects/clr/hipamd/src/hip_graph.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index a0bffed2f7..9dd7b93d6e 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -775,7 +775,10 @@ hipError_t hipStreamBeginCapture(hipStream_t stream, hipStreamCaptureMode mode) hipError_t hipStreamEndCapture(hipStream_t stream, hipGraph_t* pGraph) { HIP_INIT_API(hipStreamEndCapture, stream, pGraph); - if (pGraph == nullptr || stream == nullptr) { + if (pGraph == nullptr) { + HIP_RETURN(hipErrorInvalidValue); + } + if (stream == nullptr) { HIP_RETURN(hipErrorIllegalState); } if (!hip::isValid(stream)) {