From dcac09992222ad9774bb6322cd0ef8ebf7258855 Mon Sep 17 00:00:00 2001 From: Payam Date: Tue, 15 Feb 2022 10:54:38 -0500 Subject: [PATCH] SWDEV-316819 - Adding Graph null check Change-Id: I22774109a13c3123e89b82bd6e05e1eea26f80fc --- hipamd/src/hip_graph.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hipamd/src/hip_graph.cpp b/hipamd/src/hip_graph.cpp index af725f57ee..873ecaee22 100644 --- a/hipamd/src/hip_graph.cpp +++ b/hipamd/src/hip_graph.cpp @@ -1134,10 +1134,13 @@ hipError_t hipGraphExecKernelNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo hipError_t hipGraphChildGraphNodeGetGraph(hipGraphNode_t node, hipGraph_t* pGraph) { HIP_INIT_API(hipGraphChildGraphNodeGetGraph, node, pGraph); - if (node == nullptr) { + if (node == nullptr || pGraph == nullptr) { HIP_RETURN(hipErrorInvalidValue); } *pGraph = reinterpret_cast(node)->GetChildGraph(); + if (pGraph == nullptr) { + HIP_RETURN(hipErrorInvalidValue); + } HIP_RETURN(hipSuccess); }