SWDEV-253654 : Added invalid parameter checks

Change-Id: I8a2ae1ee6898f111aac1c68663a653cca410daec


[ROCm/hip commit: 464e27829c]
이 커밋은 다음에 포함됨:
Sarbojit Sarkar 작성하고 Sarbojit Sarkar가 2020-09-29 13:20:27 -04:00를 커밋함
1 부모 50910964ea
커밋 de746bc845
1 파일이 변경됨
+4
+4
파일 보기
@@ -97,6 +97,10 @@ hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2,
uint32_t* linktype, uint32_t* hopcount) {
HIP_INIT_API(hipExtGetLinkTypeAndHopCount, device1, device2, linktype, hopcount);
if (linktype == nullptr || hopcount == nullptr ||
device1 == device2 || device1 < 0 || device2 < 0) {
HIP_RETURN(hipErrorInvalidValue);
}
// Fill out the list of LinkAttributes
std::vector<amd::Device::LinkAttrType> link_attrs;
link_attrs.push_back(std::make_pair(amd::Device::LinkAttribute::kLinkLinkType, 0));