diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp index 16bcb9c2cf..8e02190074 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp @@ -211,7 +211,7 @@ hsa_status_t hsa_amd_memory_fill(void* ptr, uint32_t value, size_t count) { TRY; IS_OPEN(); - if (ptr == NULL) { + if ((ptr == nullptr) || (uintptr_t(ptr) % 4 != 0)) { return HSA_STATUS_ERROR_INVALID_ARGUMENT; }