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

Commit ac207ed2 authored by Zhao Yakui's avatar Zhao Yakui Committed by Dave Airlie
Browse files

ttm: Clear the ttm page allocated from high memory zone correctly

The TTM page can be allocated from high memory. In such case it is
wrong to use the page_address(page) as the virtual address for the high memory
page.

bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50241



Signed-off-by: default avatarZhao Yakui <yakui.zhao@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 888155bb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -749,6 +749,9 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
	/* clear the pages coming from the pool if requested */
	if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) {
		list_for_each_entry(p, &plist, lru) {
			if (PageHighMem(p))
				clear_highpage(p);
			else
				clear_page(page_address(p));
		}
	}