[PATCH] drm/mm: Fix support 4 GiB and larger ranges
authorKrzysztof Kolasa <kkolasa@winsoft.pl>
Sun, 15 Mar 2015 19:22:36 +0000 (20:22 +0100)
committerDave Airlie <airlied@redhat.com>
Sun, 15 Mar 2015 20:28:50 +0000 (06:28 +1000)
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 <kkolasa@winsoft.pl>
Reviewed-by: Chris wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_mm.c

index 7fc6f8bd4821c5ce60cd60bba97bd281bd6f44dd..1134526286c819c87bc523a1b8852dc485804046 100644 (file)
@@ -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;
        }