Don't crash for hipEventDestroy(NULL)

Change-Id: I3f4de1ad2712dbe8af81e10c5d3bef16d468c582


[ROCm/hip commit: 7ddb6b6b76]
This commit is contained in:
Maneesh Gupta
2017-07-18 11:01:02 +05:30
parent f16a9b9225
commit f4ca1c96c4
+8 -5
View File
@@ -164,13 +164,16 @@ hipError_t hipEventDestroy(hipEvent_t event)
{
HIP_INIT_API(event);
event->_state = hipEventStatusUnitialized;
if (event) {
event->_state = hipEventStatusUnitialized;
delete event;
event = NULL;
delete event;
event = NULL;
// TODO - examine return additional error codes
return ihipLogStatus(hipSuccess);
return ihipLogStatus(hipSuccess);
} else {
return ihipLogStatus(hipErrorInvalidResourceHandle);
}
}
hipError_t hipEventSynchronize(hipEvent_t event)