diff options
author | Rizzo Davide <davide@elpa.it> | 2008-02-05 02:44:48 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2008-02-07 05:38:12 -0500 |
commit | 484b8e64c848185af0d3671fafba4dd66ca412d2 (patch) | |
tree | 99a2bdfd37288ab7f7e00311fa86cf771fe53e34 /drivers/mtd | |
parent | 53fb84a0695ffeeeadf8ae92db28cbccf5325531 (diff) |
[MTD] [NOR] fix startup lock when using multiple nor flash chips
Taken from http://bugzilla.kernel.org/show_bug.cgi?id=9829
I found and solved the problem, at line 115 of drivers/mtd/chips/gen_probe.c
(kernel 2.6.24): mapsize value must be calculated in bytes, not in long.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/chips/gen_probe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c index 2eb696d7b97b..d338b8c92780 100644 --- a/drivers/mtd/chips/gen_probe.c +++ b/drivers/mtd/chips/gen_probe.c | |||
@@ -112,7 +112,7 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi | |||
112 | max_chips = 1; | 112 | max_chips = 1; |
113 | } | 113 | } |
114 | 114 | ||
115 | mapsize = (max_chips + BITS_PER_LONG-1) / BITS_PER_LONG; | 115 | mapsize = sizeof(long) * ( (max_chips + BITS_PER_LONG-1) / BITS_PER_LONG ); |
116 | chip_map = kzalloc(mapsize, GFP_KERNEL); | 116 | chip_map = kzalloc(mapsize, GFP_KERNEL); |
117 | if (!chip_map) { | 117 | if (!chip_map) { |
118 | printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name); | 118 | printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name); |