gpu: ion: Add warning during client freeing
Add warning when freeing client with buffers that are currently
mappped.
Change-Id: Ib8e17786daa7c890245c3d3e37143137cae7d078
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 930ba83..3bc3280 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -204,6 +204,7 @@
/* XXX Can a handle be destroyed while it's map count is non-zero?:
if (handle->map_cnt) unmap
*/
+ WARN_ON(handle->kmap_cnt || handle->dmap_cnt || handle->usermap_cnt);
ion_buffer_put(handle->buffer);
mutex_lock(&handle->client->lock);
if (!RB_EMPTY_NODE(&handle->node))