SWDEV-318128 - Add Null checks in hipGraphExecHostNodeSetParams API

Change-Id: I1363b16646b7629c827ace4db4c7b0da32486edb
This commit is contained in:
Satyanvesh Dittakavi
2022-01-12 16:06:14 +00:00
parent c8103470d5
commit dcd0322f52
+2 -1
View File
@@ -1515,7 +1515,8 @@ hipError_t hipGraphHostNodeSetParams(hipGraphNode_t node, const hipHostNodeParam
hipError_t hipGraphExecHostNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node,
const hipHostNodeParams* pNodeParams) {
HIP_INIT_API(hipGraphExecHostNodeSetParams, hGraphExec, node, pNodeParams);
if (pNodeParams->fn == nullptr || pNodeParams->userData == nullptr) {
if (hGraphExec == nullptr || pNodeParams == nullptr ||
pNodeParams->fn == nullptr || pNodeParams->userData == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
hipGraphNode_t clonedNode = hGraphExec->GetClonedNode(node);