提交 d67d1d7f 编写于 作者: M Mariusz Kozlowski 提交者: David Woodhouse

[MTD] drivers/mtd/inftlmount.c: kmalloc + memset conversion to kcalloc

Signed-off-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 8f0f23f9
......@@ -580,14 +580,13 @@ int INFTL_mount(struct INFTLrecord *s)
logical_block = block = BLOCK_NIL;
/* Temporary buffer to store ANAC numbers. */
ANACtable = kmalloc(s->nb_blocks * sizeof(u8), GFP_KERNEL);
ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
if (!ANACtable) {
printk(KERN_WARNING "INFTL: allocation of ANACtable "
"failed (%zd bytes)\n",
s->nb_blocks * sizeof(u8));
return -ENOMEM;
}
memset(ANACtable, 0, s->nb_blocks);
/*
* First pass is to explore each physical unit, and construct the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册