[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
@@ -373,12 +373,10 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
|
||||
if (!blktrans_notifier.list.next)
|
||||
register_mtd_user(&blktrans_notifier);
|
||||
|
||||
tr->blkcore_priv = kmalloc(sizeof(*tr->blkcore_priv), GFP_KERNEL);
|
||||
tr->blkcore_priv = kzalloc(sizeof(*tr->blkcore_priv), GFP_KERNEL);
|
||||
if (!tr->blkcore_priv)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(tr->blkcore_priv, 0, sizeof(*tr->blkcore_priv));
|
||||
|
||||
mutex_lock(&mtd_table_mutex);
|
||||
|
||||
ret = register_blkdev(tr->major, tr->name);
|
||||
|
Reference in New Issue
Block a user