yagl_server.c
Add a null-pointer checking statement
yagl_device.c & vigs_gl_backend.c
Remove statements that is not used, because the conditions cannot be true.
Change-Id: Iee478bf6caafe5dab352f26afc4c3ac1413f6ef4
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
break;
default:
assert(false);
- goto fail;
+ return NULL;
}
tex_bpp = vigs_format_bpp(format);
if ((width * tex_bpp) != stride) {
VIGS_LOG_ERROR("Custom strides not supported yet");
- goto fail;
+ return NULL;
}
gl_sfc = g_malloc0(sizeof(*gl_sfc));
gl_sfc->base.destroy = &vigs_gl_surface_destroy;
return &gl_sfc->base;
-
-fail:
- if (ws_sfc) {
- vigs_winsys_gl_surface_orphan(ws_sfc);
- }
-
- if (gl_sfc) {
- vigs_surface_cleanup(&gl_sfc->base);
-
- g_free(gl_sfc);
- }
-
- return NULL;
}
static void vigs_gl_backend_read_pixels_work(struct work_queue_item *wq_item)
return 0;
fail:
- if (egl_backend) {
- egl_backend->destroy(egl_backend);
- }
-
if (gles_driver) {
gles_driver->destroy(gles_driver);
}
goto out;
fail:
- for (i = count; i > 0; --i) {
- if (pages[i - 1]) {
- cpu_physical_memory_unmap(pages[i - 1],
- TARGET_PAGE_SIZE,
- false,
- TARGET_PAGE_SIZE);
+ if (pages) {
+ for (i = count; i > 0; --i) {
+ if (pages[i - 1]) {
+ cpu_physical_memory_unmap(pages[i - 1],
+ TARGET_PAGE_SIZE,
+ false,
+ TARGET_PAGE_SIZE);
+ }
}
+ g_free(pages);
}
- g_free(pages);
out:
YAGL_LOG_FUNC_EXIT(NULL);