aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/physmap_of.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-12-29 14:15:23 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-01-02 05:04:56 -0500
commite026255f7d0e56006a147b190ae23be95cb0a9bd (patch)
tree6bfc2be2cc917e65aedf2d18b6b3cd696974c934 /drivers/mtd/maps/physmap_of.c
parentbb6a77554935a86686039097cdda2b2a38891c78 (diff)
mtd: physmap_of: Correct the size argument to kzalloc
mtd_list has type struct mtd_info **, not struct mtd_info *, so the elements of the array should have pointer type, not structure type. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @disable sizeof_type_expr@ type T; T **x; @@ x = <+...sizeof( - T + *x )...+> // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps/physmap_of.c')
-rw-r--r--drivers/mtd/maps/physmap_of.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 61e4eb48bb2d..1d91333010b1 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -217,7 +217,7 @@ static int __devinit of_flash_probe(struct of_device *dev,
217 217
218 dev_set_drvdata(&dev->dev, info); 218 dev_set_drvdata(&dev->dev, info);
219 219
220 mtd_list = kzalloc(sizeof(struct mtd_info) * count, GFP_KERNEL); 220 mtd_list = kzalloc(sizeof(*mtd_list) * count, GFP_KERNEL);
221 if (!mtd_list) 221 if (!mtd_list)
222 goto err_flash_remove; 222 goto err_flash_remove;
223 223