Merge "gralloc: Move getAllocator in unlock"
diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp
index 10d372a..30754dd 100644
--- a/libgralloc/mapper.cpp
+++ b/libgralloc/mapper.cpp
@@ -247,9 +247,9 @@
return -EINVAL;
int err = 0;
private_handle_t* hnd = (private_handle_t*)handle;
- IMemAlloc* memalloc = getAllocator(hnd->flags);
if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) {
+ IMemAlloc* memalloc = getAllocator(hnd->flags);
if (hnd->flags & private_handle_t::PRIV_FLAGS_NEEDS_FLUSH) {
err = memalloc->clean_buffer((void*)hnd->base,
hnd->size, hnd->offset, hnd->fd,