From: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
To: linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>,
Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH] early_res: fix check in free_early_partial
Date: Fri, 4 Jun 2010 23:10:25 +0200 [thread overview]
Message-ID: <20100604211025.GA17881@os.inf.tu-dresden.de> (raw)
free_early_partial must check the returned region of find_overlapped_early()
whether it is a region at all. Otherwise the function will indefinitely
loop.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
---
kernel/early_res.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/early_res.c b/kernel/early_res.c
index 31aa933..9afcb4c 100644
--- a/kernel/early_res.c
+++ b/kernel/early_res.c
@@ -341,10 +341,11 @@ void __init free_early_partial(u64 start, u64 end)
try_next:
i = find_overlapped_early(start, end);
- if (i >= max_early_res)
+ r = &early_res[i];
+
+ if (i >= max_early_res || !r->end)
return;
- r = &early_res[i];
/* hole ? */
if (r->end >= end && r->start <= start) {
drop_range_partial(i, start, end);
--
1.7.1
next reply other threads:[~2010-06-04 21:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 21:10 Adam Lackorzynski [this message]
2010-06-05 0:00 ` Yinghai Lu
2010-06-06 11:32 ` Adam Lackorzynski
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=20100604211025.GA17881@os.inf.tu-dresden.de \
--to=adam@os.inf.tu-dresden.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=yinghai@kernel.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
all inboxes | Powered by JetHome®