summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/tegra/nvmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/tegra/nvmap.c b/drivers/video/tegra/nvmap.c
index 771f3ef133d7..29594e013a35 100644
--- a/drivers/video/tegra/nvmap.c
+++ b/drivers/video/tegra/nvmap.c
@@ -1036,7 +1036,9 @@ void _nvmap_handle_free(struct nvmap_handle *h)
}
/* ensure that no stale data remains in the cache for this handle */
- e = _nvmap_do_cache_maint(h, 0, h->size, NVMEM_CACHE_OP_WB_INV, false);
+ if (h->alloc || h->pgalloc)
+ e = _nvmap_do_cache_maint(h, 0, h->size,
+ NVMEM_CACHE_OP_WB_INV, false);
if (h->alloc && !h->heap_pgalloc)
nvmap_carveout_free(h->carveout.co_heap, h->carveout.block_idx);