From: Krzysztof Kolasa Date: Sun, 15 Mar 2015 19:22:36 +0000 (+0100) Subject: [PATCH] drm/mm: Fix support 4 GiB and larger ranges X-Git-Tag: firefly_0821_release~176^2~2152^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=046d669c62f37323ef0329c41d83a03c06b2087d;p=firefly-linux-kernel-4.4.55.git [PATCH] drm/mm: Fix support 4 GiB and larger ranges bad argument if(tmp)... in check_free_hole fix oops: kernel BUG at drivers/gpu/drm/drm_mm.c:305! [airlied: excellent, this was my task for today]. Signed-off-by: Krzysztof Kolasa Reviewed-by: Chris wilson Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 7fc6f8bd4821..1134526286c8 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -403,7 +403,7 @@ static int check_free_hole(u64 start, u64 end, u64 size, unsigned alignment) unsigned rem; rem = do_div(tmp, alignment); - if (tmp) + if (rem) start += alignment - rem; }