diff --git a/hipamd/src/hip_graph.cpp b/hipamd/src/hip_graph.cpp index 8a9484926d..837eb39b67 100644 --- a/hipamd/src/hip_graph.cpp +++ b/hipamd/src/hip_graph.cpp @@ -887,8 +887,14 @@ hipError_t hipGraphAddChildGraphNode(hipGraphNode_t* pGraphNode, hipGraph_t grap } hipError_t ihipGraphInstantiate(hipGraphExec_t* pGraphExec, hipGraph_t graph) { + if (pGraphExec == nullptr || graph == nullptr) { + HIP_RETURN(hipErrorInvalidValue); + } std::unordered_map clonedNodes; hipGraph_t clonedGraph = graph->clone(clonedNodes); + if (clonedGraph == nullptr) { + HIP_RETURN(hipErrorInvalidValue); + } std::vector> parallelLists; std::unordered_map> nodeWaitLists; clonedGraph->GetRunList(parallelLists, nodeWaitLists);