From 01b35916c7087072b2fca9769815bb96167a23ab Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Wed, 22 Aug 2018 21:45:23 -0500 Subject: [PATCH] Check fill addresses for alignment. Check was documented but missing. Change-Id: I97951635d794fd22e20c25d20e9d0e35035254af [ROCm/ROCR-Runtime commit: 3357cadeec8349bdbaa510aaed8334534e258add] --- .../runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }