Skip to content

Commit

Permalink
[MTD] pmc551 use kzalloc
Browse files Browse the repository at this point in the history
Use kzalloc instad of kmalloc+memset(0).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Jiri Slaby authored and David Woodhouse committed Sep 22, 2006
1 parent cdf0a7d commit 7fefb92
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/mtd/devices/pmc551.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,23 +732,20 @@ static int __init init_pmc551(void)
msize = length;
}

mtd = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL);
if (!mtd) {
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD "
"device.\n");
break;
}

memset(mtd, 0, sizeof(struct mtd_info));

priv = kmalloc(sizeof(struct mypriv), GFP_KERNEL);
priv = kzalloc(sizeof(struct mypriv), GFP_KERNEL);
if (!priv) {
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD "
"device.\n");
kfree(mtd);
break;
}
memset(priv, 0, sizeof(*priv));
mtd->priv = priv;
priv->dev = PCI_Device;

Expand Down

0 comments on commit 7fefb92

Please sign in to comment.