m68k/amiga: Chip RAM - Use resource_size() to fix off-by-one error

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
Geert Uytterhoeven 2011-04-27 10:28:19 +02:00
parent cab49bc95d
commit cb4f9988f8

View 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);