aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtd_blkdevs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r--drivers/mtd/mtd_blkdevs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index b5d62cb357da..b879a66daa9e 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -373,12 +373,10 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
373 if (!blktrans_notifier.list.next) 373 if (!blktrans_notifier.list.next)
374 register_mtd_user(&blktrans_notifier); 374 register_mtd_user(&blktrans_notifier);
375 375
376 tr->blkcore_priv = kmalloc(sizeof(*tr->blkcore_priv), GFP_KERNEL); 376 tr->blkcore_priv = kzalloc(sizeof(*tr->blkcore_priv), GFP_KERNEL);
377 if (!tr->blkcore_priv) 377 if (!tr->blkcore_priv)
378 return -ENOMEM; 378 return -ENOMEM;
379 379
380 memset(tr->blkcore_priv, 0, sizeof(*tr->blkcore_priv));
381
382 mutex_lock(&mtd_table_mutex); 380 mutex_lock(&mtd_table_mutex);
383 381
384 ret = register_blkdev(tr->major, tr->name); 382 ret = register_blkdev(tr->major, tr->name);