gpu: ion: Do the cache op when the buffer is cached
Only do the cache operation when the buffer is cached.
If the buffer is uncached, just return. Fixes a bug
where the cache was only being flushed when the buffer
was uncached instead of cached.
Change-Id: Ib1fa01168de79d5627b11d07c5313d19b3049145
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index a9dfc60..c37d952 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -630,7 +630,7 @@
buffer = handle->buffer;
mutex_lock(&buffer->lock);
- if (ION_IS_CACHED(buffer->flags)) {
+ if (!ION_IS_CACHED(buffer->flags)) {
ret = 0;
goto out;
}