SWDEV-478097 - Check for parents size in case of VA Mem object.
Change-Id: Icfdeabeb178c0dcc8c3a4bc48eec40067985794e
Tá an tiomantas seo le fáil i:
tiomanta ag
Karthik Jayaprakash
tuismitheoir
6576be5602
tiomantas
d7b097c994
@@ -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;
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir