mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
[MTD] replace kmalloc+memset with kzalloc
Signed-off-by: Yan Burman <yan_952@hotmail.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
committed by
David Woodhouse
parent
998a43e72d
commit
95b93a0cd4
@@ -278,11 +278,10 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
|
||||
}
|
||||
|
||||
/* OK, it's not open. Create cache info for it */
|
||||
mtdblk = kmalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
|
||||
mtdblk = kzalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
|
||||
if (!mtdblk)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(mtdblk, 0, sizeof(*mtdblk));
|
||||
mtdblk->count = 1;
|
||||
mtdblk->mtd = mtd;
|
||||
|
||||
@@ -339,13 +338,11 @@ static int mtdblock_flush(struct mtd_blktrans_dev *dev)
|
||||
|
||||
static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
|
||||
{
|
||||
struct mtd_blktrans_dev *dev = kmalloc(sizeof(*dev), GFP_KERNEL);
|
||||
struct mtd_blktrans_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
memset(dev, 0, sizeof(*dev));
|
||||
|
||||
dev->mtd = mtd;
|
||||
dev->devnum = mtd->index;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user