drm/ttm: dma: Don't crash on memory in the vmalloc range
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 15 May 2015 07:09:54 +0000 (16:09 +0900)
committerDave Airlie <airlied@redhat.com>
Tue, 2 Jun 2015 07:24:49 +0000 (17:24 +1000)
commit1c34d824bd750f4a4287639fee8335ec51530024
tree285da60c759743991f5727d8e1a4fd4754482111
parent95872b49ce14169a1ce0dfaac62e284cbdc6eea8
drm/ttm: dma: Don't crash on memory in the vmalloc range

dma_alloc_coherent() can return memory in the vmalloc range.
virt_to_page() cannot handle such addresses and crashes. This
patch detects such cases and obtains the struct page * using
vmalloc_to_page() instead.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c