summaryrefslogtreecommitdiff
path: root/intel
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-02-02 10:57:12 +1000
committerDave Airlie <airlied@redhat.com>2010-02-02 10:57:12 +1000
commit973d8d6bd04230da801a8bc19af41dbc60e1918d (patch)
treed1683379d388cb2692b15b9aabb790f998a30c17 /intel
parent53e261c01db9beae3648ec675513b7ed662735f5 (diff)
intel: check return value for calloc
Diffstat (limited to 'intel')
-rw-r--r--intel/intel_bufmgr_gem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index f3af3a96..0d011a2a 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1727,6 +1727,9 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
unsigned long size;
bufmgr_gem = calloc(1, sizeof(*bufmgr_gem));
+ if (bufmgr_gem == NULL)
+ return NULL;
+
bufmgr_gem->fd = fd;
if (pthread_mutex_init(&bufmgr_gem->lock, NULL) != 0) {