commit 11572a07f0aaf25357de5f8be27428bd33995c13 Author: Pierre Willenbrock Date: Sat Oct 18 20:17:04 2008 +0200 Add guard against highmem pages Signed-off-by: Pierre Willenbrock diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c index 3d33b82..7d40c81 100644 --- a/drivers/gpu/drm/drm_agpsupport.c +++ b/drivers/gpu/drm/drm_agpsupport.c @@ -480,8 +480,15 @@ drm_agp_bind_pages(struct drm_device *dev, return NULL; } - for (i = 0; i < num_pages; i++) + for (i = 0; i < num_pages; i++) { mem->memory[i] = phys_to_gart(page_to_phys(pages[i])); + if (page_to_phys(pages[i]) >> 32) { + DRM_ERROR("Found physical page address outside " + "of 32bit: %llx.\n", page_to_phys(pages[i])); + agp_free_memory(mem); + return NULL; + } + } mem->page_count = num_pages; mem->is_flushed = true;