summaryrefslogtreecommitdiff
path: root/gralloc/framebuffer_device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gralloc/framebuffer_device.cpp')
-rw-r--r--gralloc/framebuffer_device.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gralloc/framebuffer_device.cpp b/gralloc/framebuffer_device.cpp
index cfc480fa..30047780 100644
--- a/gralloc/framebuffer_device.cpp
+++ b/gralloc/framebuffer_device.cpp
@@ -469,6 +469,12 @@ int framebuffer_device_open(hw_module_t const *module, const char *name, hw_devi
/* initialize our state here */
framebuffer_device_t *dev = (framebuffer_device_t *)malloc(sizeof(framebuffer_device_t));
+ if (dev == NULL)
+ {
+ AERR("Error to malloc the framebuffer (%s)", strerror(errno));
+ gralloc_close(gralloc_device);
+ return -ENOMEM;
+ }
memset(dev, 0, sizeof(*dev));
/* initialize the procs */