[MTD] pmc551 use kzalloc
Use kzalloc instad of kmalloc+memset(0). Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
cdf0a7d169
commit
7fefb924d7
1 changed files with 2 additions and 5 deletions
|
@ -732,23 +732,20 @@ static int __init init_pmc551(void)
|
||||||
msize = length;
|
msize = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
mtd = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
|
mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL);
|
||||||
if (!mtd) {
|
if (!mtd) {
|
||||||
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD "
|
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD "
|
||||||
"device.\n");
|
"device.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(mtd, 0, sizeof(struct mtd_info));
|
priv = kzalloc(sizeof(struct mypriv), GFP_KERNEL);
|
||||||
|
|
||||||
priv = kmalloc(sizeof(struct mypriv), GFP_KERNEL);
|
|
||||||
if (!priv) {
|
if (!priv) {
|
||||||
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD "
|
printk(KERN_NOTICE "pmc551: Cannot allocate new MTD "
|
||||||
"device.\n");
|
"device.\n");
|
||||||
kfree(mtd);
|
kfree(mtd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
memset(priv, 0, sizeof(*priv));
|
|
||||||
mtd->priv = priv;
|
mtd->priv = priv;
|
||||||
priv->dev = PCI_Device;
|
priv->dev = PCI_Device;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue