All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manish Ahuja <ahuja@austin.ibm.com>
To: Paul Mackerras <paulus@samba.org>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] Infinite loop/always true check possible with unsigned counter.
Date: Mon, 09 Jul 2007 14:03:45 -0500	[thread overview]
Message-ID: <46928691.2040008@austin.ibm.com> (raw)
In-Reply-To: <469270F3.4070206@austin.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

Repost to fix my email id.

Fix to correct a possible infinite loop or an always true check when the 
unsigned long counter "i" is used in
lmb_add_region() in the following for loop:

for (i = rgn->cnt-1; i >= 0; i--)

Signed-off-by: Manish Ahuja <ahuja@austin.ibm.com>



[-- Attachment #2: unsigned --]
[-- Type: text/plain, Size: 698 bytes --]

---
 arch/powerpc/mm/lmb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: 2.6.22-rc4/arch/powerpc/mm/lmb.c
===================================================================
--- 2.6.22-rc4.orig/arch/powerpc/mm/lmb.c	2007-06-11 21:10:46.000000000 -0500
+++ 2.6.22-rc4/arch/powerpc/mm/lmb.c	2007-07-06 21:47:40.000000000 -0500
@@ -138,8 +138,8 @@ void __init lmb_analyze(void)
 static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
 				  unsigned long size)
 {
-	unsigned long i, coalesced = 0;
-	long adjacent;
+	unsigned long coalesced = 0;
+	long adjacent, i;
 
 	/* First try and coalesce this LMB with another. */
 	for (i=0; i < rgn->cnt; i++) {

  reply	other threads:[~2007-07-09 19:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09 17:31 [PATCH] Infinite loop/always true check possible with unsigned counter Manish Ahuja
2007-07-09 19:03 ` Manish Ahuja [this message]
2007-07-10  0:19   ` Paul Mackerras
2007-07-10  0:41     ` Felix Domke
2007-07-10  9:46     ` Andreas Schwab
2007-07-10  9:49       ` Paul Mackerras
2007-07-10  9:55         ` Andreas Schwab
2007-07-10 10:08           ` Paul Mackerras
2007-07-10 18:39             ` Manish Ahuja
2007-07-10 23:19               ` Paul Mackerras

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=46928691.2040008@austin.ibm.com \
    --to=ahuja@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.