From 0d6ab772de028a2f26eba39299fcdd483288e1ef Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Sat, 18 Apr 2020 10:20:32 +0200 Subject: [PATCH] gralloc0_register_buffer: initialize gralloc0 when needed Based on Michael Goffioul "Always initialize gralloc0 module" considerign that !mod->initialized defines the condition when it's needed. Original commit message: Both mapper and allocator HIDL adapter uses the same gralloc module, but the mapper HILD does not fully initialize the module, leaving the allocator HIDL in limbo if the mapper HIDL is called first. Fixes SystemUI crash on startup. --- cros_gralloc/gralloc0/gralloc0.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cros_gralloc/gralloc0/gralloc0.cc b/cros_gralloc/gralloc0/gralloc0.cc index ecae6b8..9449e5a 100644 --- a/cros_gralloc/gralloc0/gralloc0.cc +++ b/cros_gralloc/gralloc0/gralloc0.cc @@ -245,7 +245,7 @@ static int gralloc0_register_buffer(struct gralloc_module_t const *module, buffe auto mod = const_cast(const_module); if (!mod->initialized) - if (gralloc0_init(mod, false)) + if (gralloc0_init(mod, true)) return -ENODEV; int ret = mod->driver->retain(handle); -- 2.11.0