From 8dce36332dab83bb99760391b756099a0249f424 Mon Sep 17 00:00:00 2001 From: Flamefire Date: Mon, 20 Jan 2014 22:18:05 +0100 Subject: Fix crash on boot There is a race condition where the sysfs-vsync thread accesses a value (in particular a function ptr) that may not have been set yet as this is done externally. Change-Id: If1afb1533344e994398b9b6f5bd3dfb125313416 --- exynos4/hal/libhwcomposer/SecHWC.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exynos4/hal/libhwcomposer/SecHWC.cpp b/exynos4/hal/libhwcomposer/SecHWC.cpp index 1831125..0951ba3 100644 --- a/exynos4/hal/libhwcomposer/SecHWC.cpp +++ b/exynos4/hal/libhwcomposer/SecHWC.cpp @@ -965,7 +965,8 @@ static void *hwc_vsync_sysfs_loop(void *data) do { ssize_t len = read(vsync_timestamp_fd, buf, sizeof(buf)); timestamp = strtoull(buf, NULL, 0); - ctx->procs->vsync(ctx->procs, 0, timestamp); + if(ctx->procs && ctx->procs->vsync) + ctx->procs->vsync(ctx->procs, 0, timestamp); select(vsync_timestamp_fd + 1, NULL, NULL, &exceptfds, NULL); lseek(vsync_timestamp_fd, 0, SEEK_SET); } while (1); -- cgit v1.2.3