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

Commit e096b66a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ion: Use dma_free_attrs for freeing secure memory"

parents e4e5165f f2d25e3e
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -319,11 +319,14 @@ out:
static void ion_secure_cma_free_chunk(struct ion_cma_secure_heap *sheap,
					struct ion_cma_alloc_chunk *chunk)
{
	DEFINE_DMA_ATTRS(attrs);

	dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs);
	/* This region is 'allocated' and not available to allocate from */
	bitmap_set(sheap->bitmap, (chunk->handle - sheap->base) >> PAGE_SHIFT,
			chunk->chunk_size >> PAGE_SHIFT);
	dma_free_coherent(sheap->dev, chunk->chunk_size, chunk->cpu_addr,
				chunk->handle);
	dma_free_attrs(sheap->dev, chunk->chunk_size, chunk->cpu_addr,
				chunk->handle, &attrs);
	atomic_sub(chunk->chunk_size, &sheap->total_pool_size);
	list_del(&chunk->entry);
	kfree(chunk);