From 9cec2dcc94faabee8b05b74a0bec7393d154a1ef Mon Sep 17 00:00:00 2001 From: haoyuan2 Date: Mon, 22 Nov 2021 09:51:57 -0800 Subject: [PATCH] SWDEV-311856 - check if the function pointer is valid Change-Id: Iaa5bd7f8321434ce63d0bcf2791d3c65577b453d [ROCm/clr commit: 1101cfedf5c2c89a407fd081647f8011d2dc0132] --- projects/clr/hipamd/src/hip_graph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index 3975c1e0ca..5489c72b25 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -1055,7 +1055,8 @@ hipError_t hipGraphAddDependencies(hipGraph_t graph, const hipGraphNode_t* from, hipError_t hipGraphExecKernelNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, const hipKernelNodeParams* pNodeParams) { HIP_INIT_API(hipGraphExecKernelNodeSetParams, hGraphExec, node, pNodeParams); - if (hGraphExec == nullptr || node == nullptr || pNodeParams == nullptr) { + if (hGraphExec == nullptr || node == nullptr || pNodeParams == nullptr || + pNodeParams->func == nullptr) { HIP_RETURN(hipErrorInvalidValue); } hipGraphNode_t clonedNode = hGraphExec->GetClonedNode(node);