[Mesa-dev] [PATCH 01/11] gbm/dri: Fix out-of-memory error path in dri_device_create()

Ander Conselvan de Oliveira conselvan2 at gmail.com
Tue Apr 8 13:28:38 PDT 2014


From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>

Cc: "10.0" "10.1" <mesa-stable at lists.freedesktop.org>
---
 src/gbm/backends/dri/gbm_dri.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 50fa588..f681836 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -722,6 +722,8 @@ dri_device_create(int fd)
    int ret;
 
    dri = calloc(1, sizeof *dri);
+   if (!dri)
+      return NULL;
 
    dri->base.base.fd = fd;
    dri->base.base.bo_create = gbm_dri_bo_create;
-- 
1.8.3.2



More information about the mesa-dev mailing list