m68k/amiga: Chip RAM - Use resource_size() to fix off-by-one error
authorGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 27 Apr 2011 08:28:19 +0000 (10:28 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Sat, 30 Jul 2011 19:21:38 +0000 (21:21 +0200)
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/amiga/chipram.c

index c3fe45125f5262266a41170bc3b5d434626fa869..cfd3b7af26c6947a2ecb5038a2d89490a81fcb18 100644 (file)
@@ -100,7 +100,7 @@ void amiga_chip_free(void *ptr)
                if (res->start != start)
                        continue;
                *p = res->sibling;
-               size = res->end-start;
+               size = resource_size(res);
                pr_debug("amiga_chip_free: free %lu bytes at %p\n", size, ptr);
                atomic_add(size, &chipavail);
                kfree(res);