提交 7fefb924 编写于 作者: J Jiri Slaby 提交者: David Woodhouse

[MTD] pmc551 use kzalloc

Use kzalloc instad of kmalloc+memset(0).
Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 cdf0a7d1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册