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

Skip to content
Commit 6f87f9fd authored by Vikram Mulukutla's avatar Vikram Mulukutla Committed by Gerrit - the friendly Code Review server
Browse files

tracing: Fix unmapping loop in tracing_mark_write



Commit 6edb2a8a introduced
an array map_pages that contains the addresses returned by
kmap_atomic. However, when unmapping those pages, map_pages[0]
is unmapped before map_pages[1], breaking the nesting requirement
as specified in the documentation:

	If you need to map two pages because you want to copy
	from one page to another you need to keep the kmap_atomic
	calls strictly nested, like:

	vaddr1 = kmap_atomic(page1);
	vaddr2 = kmap_atomic(page2);

	memcpy(vaddr1, vaddr2, PAGE_SIZE);

	kunmap_atomic(vaddr2);
	kunmap_atomic(vaddr1);

This was caught by the highmem debug code present in kunmap_atomic.
Fix the loop to do the unmapping properly.

Change-Id: Iae08ed39f42df7088e72acd001e67c84a926a1b1
Reported-by: default avatarLime Yang <limey@codeaurora.org>
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent f1a96f69
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment