slram: Read buffer overflow

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Sep 4 04:59:04 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=269c0ee66367b11de9758ee64ea039843f0c7cad
Commit:     269c0ee66367b11de9758ee64ea039843f0c7cad
Parent:     ad4fbc7921bd7cca108ecc1340a014e91ecc8536
Author:     Roel Kluin <roel.kluin at gmail.com>
AuthorDate: Fri Jul 31 14:47:58 2009 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Sep 4 09:40:09 2009 +0100

    slram: Read buffer overflow
    
    map[count] is checked before count < SLRAM_MAX_DEVICES_PARAMS
    
    Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/devices/slram.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
index 00248e8..239500b 100644
--- a/drivers/mtd/devices/slram.c
+++ b/drivers/mtd/devices/slram.c
@@ -341,7 +341,7 @@ static int init_slram(void)
 #else
 	int count;
 
-	for (count = 0; (map[count]) && (count < SLRAM_MAX_DEVICES_PARAMS);
+	for (count = 0; count < SLRAM_MAX_DEVICES_PARAMS && map[count];
 			count++) {
 	}
 



More information about the linux-mtd-cvs mailing list