* [patch 6/8] slram: fix read buffer overflow
@ 2009-08-06 23:05 akpm
2009-08-07 2:58 ` Josh Boyer
0 siblings, 1 reply; 3+ messages in thread
From: akpm @ 2009-08-06 23:05 UTC (permalink / raw)
To: dwmw2; +Cc: roel.kluin, akpm, linux-mtd
From: Roel Kluin <roel.kluin@gmail.com>
map[count] is checked before count < SLRAM_MAX_DEVICES_PARAMS
declared on drivers/mtd/devices/slram.c:66:
static char *map[SLRAM_MAX_DEVICES_PARAMS];
[akpm@linux-foundation.org: cleanups]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/mtd/devices/slram.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff -puN drivers/mtd/devices/slram.c~slram-read-buffer-overflow drivers/mtd/devices/slram.c
--- a/drivers/mtd/devices/slram.c~slram-read-buffer-overflow
+++ a/drivers/mtd/devices/slram.c
@@ -341,9 +341,8 @@ static int __init init_slram(void)
#else
int count;
- for (count = 0; (map[count]) && (count < SLRAM_MAX_DEVICES_PARAMS);
- count++) {
- }
+ for (count = 0; count < SLRAM_MAX_DEVICES_PARAMS && map[count]; count++)
+ ;
if ((count % 3 != 0) || (count == 0)) {
E("slram: not enough parameters.\n");
_
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 6/8] slram: fix read buffer overflow
2009-08-06 23:05 [patch 6/8] slram: fix read buffer overflow akpm
@ 2009-08-07 2:58 ` Josh Boyer
2009-08-10 7:04 ` Artem Bityutskiy
0 siblings, 1 reply; 3+ messages in thread
From: Josh Boyer @ 2009-08-07 2:58 UTC (permalink / raw)
To: akpm; +Cc: roel.kluin, dwmw2, linux-mtd
On Thu, Aug 06, 2009 at 04:05:36PM -0700, akpm@linux-foundation.org wrote:
>From: Roel Kluin <roel.kluin@gmail.com>
>
>map[count] is checked before count < SLRAM_MAX_DEVICES_PARAMS
>
>declared on drivers/mtd/devices/slram.c:66:
Didn't we obsolete this driver with phram? I don't mean to derail the patch,
but I'm wondering why slram still exists at all.
josh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 6/8] slram: fix read buffer overflow
2009-08-07 2:58 ` Josh Boyer
@ 2009-08-10 7:04 ` Artem Bityutskiy
0 siblings, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2009-08-10 7:04 UTC (permalink / raw)
To: Josh Boyer; +Cc: dwmw2, akpm, roel.kluin, linux-mtd
On 08/07/2009 05:58 AM, Josh Boyer wrote:
> On Thu, Aug 06, 2009 at 04:05:36PM -0700, akpm@linux-foundation.org wrote:
>> From: Roel Kluin<roel.kluin@gmail.com>
>>
>> map[count] is checked before count< SLRAM_MAX_DEVICES_PARAMS
>>
>> declared on drivers/mtd/devices/slram.c:66:
>
> Didn't we obsolete this driver with phram? I don't mean to derail the patch,
> but I'm wondering why slram still exists at all.
Feel free to send a patch. Meanwhile, I've put this fix to my l2-mtd-2.6.git.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-10 7:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-06 23:05 [patch 6/8] slram: fix read buffer overflow akpm
2009-08-07 2:58 ` Josh Boyer
2009-08-10 7:04 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).