From: Ander Conselvan de Oliveira Date: Tue, 8 Apr 2014 20:28:38 +0000 (+0300) Subject: gbm/dri: Fix out-of-memory error path in dri_device_create() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa91fe1c09e066751c5419adb7810745336bd051;p=mesa.git gbm/dri: Fix out-of-memory error path in dri_device_create() Cc: "10.0" "10.1" Reviewed-by: Emil Velikov --- diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 50fa588ff39..f6818366b17 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;