SWDEV-318123 - Address hipGraphHostNodeSetParams negative scenarios

Change-Id: I4884a364b40e93c779ca84f34eee4688f3583aab


[ROCm/clr commit: de069729a5]
Tá an tiomantas seo le fáil i:
Satyanvesh Dittakavi tiomanta 2022-03-18 12:08:28 -04:00
1 tuismitheoir 8108b3dd74
tiomantas 64153a23d7
1 comhad athraithe
+4 -3
+4 -3
Féach ar an gComhad
@@ -1711,7 +1711,8 @@ hipError_t hipGraphHostNodeGetParams(hipGraphNode_t node, hipHostNodeParams* pNo
hipError_t hipGraphHostNodeSetParams(hipGraphNode_t node, const hipHostNodeParams* pNodeParams) {
HIP_INIT_API(hipGraphHostNodeSetParams, node, pNodeParams);
if (pNodeParams->fn == nullptr || pNodeParams->userData == nullptr) {
if (pNodeParams == nullptr || pNodeParams->fn == nullptr || pNodeParams->userData == nullptr ||
node == nullptr || !hipGraphNode::isNodeValid(node)) {
HIP_RETURN(hipErrorInvalidValue);
}
HIP_RETURN(reinterpret_cast<hipGraphHostNode*>(node)->SetParams(pNodeParams));
@@ -1720,8 +1721,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 (hGraphExec == nullptr || pNodeParams == nullptr ||
pNodeParams->fn == nullptr || pNodeParams->userData == nullptr) {
if (hGraphExec == nullptr || pNodeParams == nullptr || pNodeParams->fn == nullptr ||
pNodeParams->userData == nullptr || node == nullptr || !hipGraphNode::isNodeValid(node)) {
HIP_RETURN(hipErrorInvalidValue);
}
hipGraphNode_t clonedNode = hGraphExec->GetClonedNode(node);