From 29d27cdee06e72fb40c4f341b3df0f98c2ce99da Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Wed, 10 Aug 2022 12:15:46 +0000 Subject: [PATCH] SWDEV-351031 - Any bit other than the rightmost 4 bits shouldn't be set Change-Id: I6c834f491ce393eb37259eabc603220c5b5f164e [ROCm/clr commit: 35051e778d8eda1dd5534711ffb43aa9e55d7fed] --- projects/clr/hipamd/src/hip_memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index 2d2e7428b9..d2864b9386 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -1089,7 +1089,7 @@ hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr) { } hipError_t ihipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags) { - if (hostPtr == nullptr || sizeBytes == 0) { + if (hostPtr == nullptr || sizeBytes == 0 || flags > 15) { return hipErrorInvalidValue; } else { amd::Memory* mem = new (*hip::host_device->asContext()) amd::Buffer(*hip::host_device->asContext(),