From: Michel Thierry Date: Thu, 25 Jun 2015 11:59:38 +0000 (+0100) Subject: drm/i915/ppgtt: Break loop in gen8_ppgtt_clear_range failure path X-Git-Tag: v4.1.4~130 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=28362ad0c52531e85a296ba2c3623c220101c628;p=users%2Fjedix%2Flinux-maple.git drm/i915/ppgtt: Break loop in gen8_ppgtt_clear_range failure path commit 00245266b4be4fbe989ee073663f56716da6c1f3 upstream. If for some reason [1], the page directory/table does not exist, clear_range would end up in an infinite while loop. Introduced by commit 06fda602dbca ("drm/i915: Create page table allocators"). [1] This is already being addressed in one of Mika's patches: http://mid.gmane.org/1432314314-23530-17-git-send-email-mika.kuoppala@intel.com Cc: Mika Kuoppala Reported-by: John Harrison Signed-off-by: Michel Thierry Reviewed-by: Mika Kuoppala Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 0239fbff7bf7..ad90fa3045e5 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -502,17 +502,17 @@ static void gen8_ppgtt_clear_range(struct i915_address_space *vm, struct page *page_table; if (WARN_ON(!ppgtt->pdp.page_directory[pdpe])) - continue; + break; pd = ppgtt->pdp.page_directory[pdpe]; if (WARN_ON(!pd->page_table[pde])) - continue; + break; pt = pd->page_table[pde]; if (WARN_ON(!pt->page)) - continue; + break; page_table = pt->page;