diff options
Diffstat (limited to 'exynos4/hal/libgralloc_ump/framebuffer_device.cpp')
-rw-r--r-- | exynos4/hal/libgralloc_ump/framebuffer_device.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/exynos4/hal/libgralloc_ump/framebuffer_device.cpp b/exynos4/hal/libgralloc_ump/framebuffer_device.cpp index 03c2606..2059af8 100644 --- a/exynos4/hal/libgralloc_ump/framebuffer_device.cpp +++ b/exynos4/hal/libgralloc_ump/framebuffer_device.cpp @@ -418,18 +418,28 @@ int framebuffer_device_open(hw_module_t const* module, const char* name, hw_devi alloc_device_t* gralloc_device; status = gralloc_open(module, &gralloc_device); - if (status < 0) + if (status < 0) { + ALOGE("Fail to Open gralloc device"); return status; + } + + /* initialize our state here */ + framebuffer_device_t *dev = (framebuffer_device_t *)malloc(sizeof(framebuffer_device_t)); + if (dev == NULL) { + ALOGE("Failed to allocate memory for dev"); + gralloc_close(gralloc_device); + return status; + } private_module_t* m = (private_module_t*)module; status = init_frame_buffer(m); if (status < 0) { + ALOGE("Fail to init framebuffer"); + free(dev); gralloc_close(gralloc_device); return status; } - /* initialize our state here */ - framebuffer_device_t *dev = new framebuffer_device_t; memset(dev, 0, sizeof(*dev)); /* initialize the procs */ |