git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mtd: pmcmsp-flash: Allocating too much in init_msp_flash()
[pandora-kernel.git]
/
drivers
/
mtd
/
maps
/
pmcmsp-flash.c
diff --git
a/drivers/mtd/maps/pmcmsp-flash.c
b/drivers/mtd/maps/pmcmsp-flash.c
index
744ca5c
..
f9fa3fa
100644
(file)
--- a/
drivers/mtd/maps/pmcmsp-flash.c
+++ b/
drivers/mtd/maps/pmcmsp-flash.c
@@
-75,15
+75,15
@@
static int __init init_msp_flash(void)
printk(KERN_NOTICE "Found %d PMC flash devices\n", fcnt);
printk(KERN_NOTICE "Found %d PMC flash devices\n", fcnt);
- msp_flash = k
malloc(fcnt * sizeof(struct map_info *
), GFP_KERNEL);
+ msp_flash = k
calloc(fcnt, sizeof(*msp_flash
), GFP_KERNEL);
if (!msp_flash)
return -ENOMEM;
if (!msp_flash)
return -ENOMEM;
- msp_parts = k
malloc(fcnt * sizeof(struct mtd_partition *
), GFP_KERNEL);
+ msp_parts = k
calloc(fcnt, sizeof(*msp_parts
), GFP_KERNEL);
if (!msp_parts)
goto free_msp_flash;
if (!msp_parts)
goto free_msp_flash;
- msp_maps = kcalloc(fcnt, sizeof(
struct mtd_info
), GFP_KERNEL);
+ msp_maps = kcalloc(fcnt, sizeof(
*msp_maps
), GFP_KERNEL);
if (!msp_maps)
goto free_msp_parts;
if (!msp_maps)
goto free_msp_parts;