From: Geert Uytterhoeven Date: Wed, 27 Apr 2011 08:28:19 +0000 (+0200) Subject: m68k/amiga: Chip RAM - Use resource_size() to fix off-by-one error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb4f9988f86746fff3183d31381deb2b2a421a3a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git m68k/amiga: Chip RAM - Use resource_size() to fix off-by-one error Signed-off-by: Geert Uytterhoeven --- diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c index c3fe45125f52..cfd3b7af26c6 100644 --- a/arch/m68k/amiga/chipram.c +++ b/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);