Browse Source

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

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Geert Uytterhoeven 14 years ago
parent
commit
cb4f9988f8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      arch/m68k/amiga/chipram.c

+ 1 - 1
arch/m68k/amiga/chipram.c

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