summaryrefslogtreecommitdiffstats
path: root/src/amd/addrlib/r800
diff options
context:
space:
mode:
authorSabre Shao <[email protected]>2016-02-25 05:30:33 -0500
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commiteb3036ed46d97d43728626207b423fdc9c09e3d7 (patch)
treed1a71fe647c8029efd9e23e03a71c52ba86e0caa /src/amd/addrlib/r800
parent680f91e5d47e6147bac1c214e921bf655a4785a3 (diff)
amdgpu/addrlib: fix crash on allocation failure
Diffstat (limited to 'src/amd/addrlib/r800')
-rw-r--r--src/amd/addrlib/r800/ciaddrlib.h3
-rw-r--r--src/amd/addrlib/r800/siaddrlib.h3
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: