fallthrough if deviceId pointer is null

Change-Id: I924996d60d0286a7be1d18881ee733459de2981c
Este commit está contenido en:
Aditya Atluri committed 2016-09-27 11:47:58 -05:00
1 padre 977918badf
commit 57872d2a88
1 file changed
+9 -5
+9 -5
Ver fichero
@@ -33,11 +33,15 @@ hipError_t hipGetDevice(int *deviceId)
auto ctx = ihipGetTlsDefaultCtx();
if (ctx == nullptr) {
e = hipErrorInvalidDevice; // TODO, check error code.
*deviceId = -1;
} else {
*deviceId = ctx->getDevice()->_deviceId;
if(deviceId != nullptr){
if (ctx == nullptr) {
e = hipErrorInvalidDevice; // TODO, check error code.
*deviceId = -1;
} else {
*deviceId = ctx->getDevice()->_deviceId;
}
}else{
e = hipErrorInvalidDevice;
}
return ihipLogStatus(e);