SWDEV-478097 - Check for parents size in case of VA Mem object.
Change-Id: Icfdeabeb178c0dcc8c3a4bc48eec40067985794e
[ROCm/clr commit: d7b097c994]
This commit is contained in:
1 parent
eac092348a
commit
2af78c954b
2 files changed
+6
-2
No files matched your search
@@ -3162,6 +3162,12 @@ hipError_t ihipMemset_validate(void* dst, int64_t value, size_t valueSize,
|
||||
// dst ptr is host ptr hence error
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
// In case of vmm sub object, validate using parents vaddr mem object.
|
||||
if (memory->parent() && (memory->getMemFlags() & CL_MEM_VA_RANGE_AMD)) {
|
||||
memory = memory->parent();
|
||||
}
|
||||
|
||||
// Return error if sizeBytes passed to memcpy is more than the actual size allocated
|
||||
if (sizeBytes > (memory->getSize() - offset)){
|
||||
return hipErrorInvalidValue;
|
||||
|
||||
Reference in new issue
Block a user