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

Commit 440d267b authored by Rajesh Kemisetti's avatar Rajesh Kemisetti
Browse files

msm: kgsl: Fix race condition while making page as dirty



set_page_dirty() is racy if the caller has no
reference against page->mapping->host, and if
the page is unlocked. This is because another
CPU could truncate the page off the mapping and
then free the mapping.

Use set_page_dirty_lock() to avoid this race condition.

Change-Id: I517fb9aee66560618c7676b311368f7a7498011f
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent 5af8d318
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ kgsl_mem_entry_destroy(struct kref *kref)
			    entry->memdesc.sgt->nents, i) {
			page = sg_page(sg);
			for (j = 0; j < (sg->length >> PAGE_SHIFT); j++)
				set_page_dirty(nth_page(page, j));
				set_page_dirty_lock(nth_page(page, j));
		}
	}