SWDEV-271496 - Added missing params check

Change-Id: I17bbf5ed445826e7380df22fa5c6ec1675e208d6


[ROCm/hip commit: 751578a37e]
이 커밋은 다음에 포함됨:
Sarbojit Sarkar
2021-02-05 05:40:41 -05:00
커밋한 사람 Sarbojit Sarkar
부모 800652cef7
커밋 f846f05f3c
2개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
+5 -5
파일 보기
@@ -40,12 +40,12 @@ amd::HostQueue* Device::NullStream(bool skip_alloc) {
hipError_t hipDeviceGet(hipDevice_t *device, int deviceId) {
HIP_INIT_API(hipDeviceGet, device, deviceId);
if (device != nullptr) {
*device = deviceId;
} else {
HIP_RETURN(hipErrorInvalidValue);
if (deviceId < 0 ||
static_cast<size_t>(deviceId) >= g_devices.size() ||
device == nullptr) {
HIP_RETURN(hipErrorInvalidDevice);
}
*device = deviceId;
HIP_RETURN(hipSuccess);
};
+3 -1
파일 보기
@@ -414,7 +414,9 @@ hipError_t hipDeviceGetPCIBusId ( char* pciBusId, int len, int device ) {
hipError_t hipDeviceGetSharedMemConfig ( hipSharedMemConfig * pConfig ) {
HIP_INIT_API(hipDeviceGetSharedMemConfig, pConfig);
if (pConfig == nullptr) {
return HIP_RETURN(hipErrorInvalidValue);
}
*pConfig = hipSharedMemBankSizeFourByte;
HIP_RETURN(hipSuccess);