summaryrefslogtreecommitdiff
path: root/libs/ui/Gralloc2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ui/Gralloc2.cpp')
-rw-r--r--libs/ui/Gralloc2.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/ui/Gralloc2.cpp b/libs/ui/Gralloc2.cpp
index 75f568657d..f8d9401a0e 100644
--- a/libs/ui/Gralloc2.cpp
+++ b/libs/ui/Gralloc2.cpp
@@ -33,7 +33,7 @@ static constexpr Error kTransactionError = Error::NO_RESOURCES;
Mapper::Mapper()
{
mMapper = IMapper::getService();
- if (mMapper != nullptr && mMapper->isRemote()) {
+ if (mMapper == nullptr || mMapper->isRemote()) {
LOG_ALWAYS_FATAL("gralloc-mapper must be in passthrough mode");
}
}
@@ -196,8 +196,9 @@ int Mapper::unlock(buffer_handle_t bufferHandle) const
Allocator::Allocator(const Mapper& mapper)
: mMapper(mapper)
{
- if (mMapper.valid()) {
- mAllocator = IAllocator::getService();
+ mAllocator = IAllocator::getService();
+ if (mAllocator == nullptr) {
+ LOG_ALWAYS_FATAL("gralloc-alloc is missing");
}
}