Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68499
b: refs/heads/master
c: 4fb4caa
h: refs/heads/master
i:
  68497: ece5492
  68495: 147af1c
v: v3
  • Loading branch information
Mariusz Kozlowski authored and David Woodhouse committed Aug 1, 2007
1 parent e509c4c commit 7c31010
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40562f812bb4b0211da07ad1927af030b089d3d3
refs/heads/master: 4fb4caa639a27a3cb0b3bfbf2041524af43efff9
22 changes: 12 additions & 10 deletions trunk/drivers/mtd/maps/pmcmsp-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ int __init init_msp_flash(void)
return -ENXIO;

printk(KERN_NOTICE "Found %d PMC flash devices\n", fcnt);
msp_flash = (struct mtd_info **)kmalloc(
fcnt * sizeof(struct map_info *), GFP_KERNEL);
msp_parts = (struct mtd_partition **)kmalloc(
fcnt * sizeof(struct mtd_partition *), GFP_KERNEL);
msp_maps = (struct map_info *)kmalloc(
fcnt * sizeof(struct mtd_info), GFP_KERNEL);
memset(msp_maps, 0, fcnt * sizeof(struct mtd_info));

msp_flash = kmalloc(fcnt * sizeof(struct map_info *), GFP_KERNEL);
msp_parts = kmalloc(fcnt * sizeof(struct mtd_partition *), GFP_KERNEL);
msp_maps = kcalloc(fcnt, sizeof(struct mtd_info), GFP_KERNEL);
if (!msp_flash || !msp_parts || !msp_maps) {
kfree(msp_maps);
kfree(msp_parts);
kfree(msp_flash);
return -ENOMEM;
}

/* loop over the flash devices, initializing each */
for (i = 0; i < fcnt; i++) {
Expand All @@ -95,9 +98,8 @@ int __init init_msp_flash(void)
continue;
}

msp_parts[i] = (struct mtd_partition *)kmalloc(
pcnt * sizeof(struct mtd_partition), GFP_KERNEL);
memset(msp_parts[i], 0, pcnt * sizeof(struct mtd_partition));
msp_parts[i] = kcalloc(pcnt, sizeof(struct mtd_partition),
GFP_KERNEL);

/* now initialize the devices proper */
flash_name[5] = '0' + i;
Expand Down

0 comments on commit 7c31010

Please sign in to comment.