SWDEV-357246 - Fixes to return with a error code instead of segfault in alloc failure case
Change-Id: Ie18d50f2f7ef3f4b2c0153152fca057232c1f8a2
This commit is contained in:
کامیت شده توسط
Maneesh Gupta
والد
47a29c748a
کامیت
aeeab1c975
@@ -226,6 +226,9 @@ hipError_t ihipMallocManaged(void** ptr, size_t size, unsigned int align) {
|
||||
}
|
||||
size_t offset = 0; //this is ignored
|
||||
amd::Memory* memObj = getMemoryObject(*ptr, offset);
|
||||
if (memObj == nullptr) {
|
||||
return hipErrorMemoryAllocation;
|
||||
}
|
||||
//saves the current device id so that it can be accessed later
|
||||
memObj->getUserData().deviceId = hip::getCurrentDevice()->deviceId();
|
||||
|
||||
|
||||
مرجع در شماره جدید
Block a user