slram: Read buffer overflow
authorRoel Kluin <roel.kluin@gmail.com>
Fri, 31 Jul 2009 12:47:58 +0000 (14:47 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 4 Sep 2009 08:40:09 +0000 (09:40 +0100)
map[count] is checked before count < SLRAM_MAX_DEVICES_PARAMS

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/slram.c

index 00248e81ecd5b3350a71a3c5e5e79c03be7af088..239500b0b75164e81ec264f7c2c1093ec429b872 100644 (file)
@@ -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++) {
        }