Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 738bd294 authored by Laura Abbott's avatar Laura Abbott
Browse files

gpu: ion: Loop on the handle count when destroying



When destroying a handle, all kernel mappings to that handle
should be destroyed. Other handles may still have references
and valid mappings to the buffer underneath which should not
be destroyed. Loop on the handle reference count, not the buffer
reference count to get rid of all kernel mappings for the handle.

Change-Id: I7dc5d6a86513fc5fa4e21110ceab434714ea2493
CRs-Fixed: 543700
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 4bb26321
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -332,7 +332,7 @@ static void ion_handle_destroy(struct kref *kref)
	struct ion_buffer *buffer = handle->buffer;
	struct ion_buffer *buffer = handle->buffer;


	mutex_lock(&buffer->lock);
	mutex_lock(&buffer->lock);
	while (buffer->kmap_cnt)
	while (handle->kmap_cnt)
		ion_handle_kmap_put(handle);
		ion_handle_kmap_put(handle);
	mutex_unlock(&buffer->lock);
	mutex_unlock(&buffer->lock);