From: Roel Kluin <roel.kluin@gmail.com>
To: dwmw2@infradead.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: [PATCH] maps: test before subtraction on unsigned long intel1size
Date: Thu, 05 Mar 2009 13:11:26 +0100 [thread overview]
Message-ID: <49AFC16E.5090904@gmail.com> (raw)
I found this by code inspection, I could be wrong, but isn't a test required
before this subtraction? note that intel1size is unsigned long.
Also I noted that the file makes extensive use of volatile. is that necessary?
------------------------------>8-------------8<---------------------------------
Test before subtraction on unsigned long intel1size.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/mtd/maps/nettel.c b/drivers/mtd/maps/nettel.c
index a97133e..ed2fc83 100644
--- a/drivers/mtd/maps/nettel.c
+++ b/drivers/mtd/maps/nettel.c
@@ -349,11 +349,12 @@ static int __init nettel_init(void)
goto out_unmap1;
}
- intel1size = intel_mtd->size - intel0size;
- if (intel1size > 0) {
+ if (intel_mtd->size > intel0size) {
+ intel1size = intel_mtd->size - intel0size;
*intel1par = SC520_PAR(intel1cs, intel1addr, intel1size);
__asm__ ("wbinvd");
} else {
+ intel1size = 0;
*intel1par = 0;
}
reply other threads:[~2009-03-05 12:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=49AFC16E.5090904@gmail.com \
--to=roel.kluin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.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.