diff options
author | Sabre Shao <[email protected]> | 2016-02-25 05:30:33 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-03-30 14:44:33 +0200 |
commit | eb3036ed46d97d43728626207b423fdc9c09e3d7 (patch) | |
tree | d1a71fe647c8029efd9e23e03a71c52ba86e0caa /src/amd/addrlib/r800 | |
parent | 680f91e5d47e6147bac1c214e921bf655a4785a3 (diff) |
amdgpu/addrlib: fix crash on allocation failure
Diffstat (limited to 'src/amd/addrlib/r800')
-rw-r--r-- | src/amd/addrlib/r800/ciaddrlib.h | 3 | ||||
-rw-r--r-- | src/amd/addrlib/r800/siaddrlib.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/amd/addrlib/r800/ciaddrlib.h b/src/amd/addrlib/r800/ciaddrlib.h index c59a0b127a1..f6c865536ce 100644 --- a/src/amd/addrlib/r800/ciaddrlib.h +++ b/src/amd/addrlib/r800/ciaddrlib.h @@ -85,7 +85,8 @@ public: /// Creates CiLib object static Addr::Lib* CreateObj(const Client* pClient) { - return new(pClient) CiLib(pClient); + VOID* pMem = Object::ClientAlloc(sizeof(CiLib), pClient); + return (pMem != NULL) ? new (pMem) CiLib(pClient) : NULL; } private: diff --git a/src/amd/addrlib/r800/siaddrlib.h b/src/amd/addrlib/r800/siaddrlib.h index 80c5cf4079f..86d21167da7 100644 --- a/src/amd/addrlib/r800/siaddrlib.h +++ b/src/amd/addrlib/r800/siaddrlib.h @@ -85,7 +85,8 @@ public: /// Creates SiLib object static Addr::Lib* CreateObj(const Client* pClient) { - return new(pClient) SiLib(pClient); + VOID* pMem = Object::ClientAlloc(sizeof(SiLib), pClient); + return (pMem != NULL) ? new (pMem) SiLib(pClient) : NULL; } protected: |