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

Commit e2ca5838 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "staging: android: ion: Properly zero cached carveout allocations"

parents bd1b34eb d13fd69c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap,
	struct sg_table *table;
	phys_addr_t paddr;
	int ret;
	struct device *dev = heap->priv;

	table = kmalloc(sizeof(*table), GFP_KERNEL);
	if (!table)
@@ -81,6 +82,10 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap,
	sg_set_page(table->sgl, pfn_to_page(PFN_DOWN(paddr)), size, 0);
	buffer->sg_table = table;

	if (ion_buffer_cached(buffer))
		ion_pages_sync_for_device(dev, sg_page(table->sgl),
					  buffer->size, DMA_FROM_DEVICE);

	return 0;

err_free_table: