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

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

Merge "ion: invalidate buffers before zero'ing"

parents fafa4e49 fe48d9eb
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -146,9 +146,11 @@ int ion_heap_pages_zero(struct page **pages, int num_pages)
		if (!ptr)
			return -ENOMEM;

		memset(ptr, 0, npages_to_vmap * PAGE_SIZE);
		/*
		 * invalidate the cache to pick up the zeroing
		 * We have to invalidate the cache here because there
		 * might be dirty lines to these physical pages (which
		 * we don't care about) that could get written out at
		 * any moment.
		 */
		for (k = 0; k < npages_to_vmap; k++) {
			void *p = kmap_atomic(pages[i + k]);
@@ -156,6 +158,7 @@ int ion_heap_pages_zero(struct page **pages, int num_pages)
			dmac_inv_range(p, p + PAGE_SIZE);
			kunmap_atomic(p);
		}
		memset(ptr, 0, npages_to_vmap * PAGE_SIZE);
		vunmap(ptr);
	}