wsl/hsakmt: Fix boundary condition in VaMgr::Alloc

Signed-off-by: lyndonli <Lyndon.Li@amd.com>
Reviewed by: Shi.Leslie <Yuliang.Shi@amd.com>

Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/19>
Этот коммит содержится в:
lyndonli
2024-09-13 18:13:29 +08:00
коммит произвёл Frank Min
родитель 4c11077c58
Коммит c06c3fd82b
+1 -1
Просмотреть файл
@@ -40,7 +40,7 @@ uint64_t VaMgr::Alloc(uint64_t bytes, uint64_t align, uint64_t addr) {
const uint64_t size = frag_it->second.size;
// Cannot find free fragment contains the target `addr`
if (bytes > size || addr < base || addr + bytes >= base + size ||
if (bytes > size || addr < base || addr + bytes > base + size ||
!is_free(frag_it->second)) {
--frag_it;
continue;