public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-m68k@lists.linux-m68k.org
Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH 5/5] m68k/amiga: Chip RAM - Use resource_size() to fix off-by-one error
Date: Sat, 21 May 2011 21:18:20 +0200	[thread overview]
Message-ID: <1306005500-29259-5-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <1306005500-29259-1-git-send-email-geert@linux-m68k.org>

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/amiga/chipram.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c
index c3fe451..cfd3b7a 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);
-- 
1.7.0.4

      parent reply	other threads:[~2011-05-21 19:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-21 19:18 [PATCH 1/5] m68k/amiga: Chip RAM - Use tabs for indentation Geert Uytterhoeven
2011-05-21 19:18 ` [PATCH 2/5] m68k/amiga: Chip RAM - Convert from printk() to pr_*() Geert Uytterhoeven
2011-05-21 19:18 ` [PATCH 3/5] m68k/amiga: Chip RAM - Always allocate from the start of memory Geert Uytterhoeven
2011-05-21 19:18 ` [PATCH 4/5] m68k/amiga: Chip RAM - Change chipavail to an atomic_t Geert Uytterhoeven
2011-05-21 19:18 ` Geert Uytterhoeven [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306005500-29259-5-git-send-email-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox