aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r--drivers/md/dm-raid1.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 1a876f9965e0..144071e70a93 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -951,13 +951,12 @@ static struct mirror_set *alloc_context(unsigned int nr_mirrors,
951 951
952 len = sizeof(*ms) + (sizeof(ms->mirror[0]) * nr_mirrors); 952 len = sizeof(*ms) + (sizeof(ms->mirror[0]) * nr_mirrors);
953 953
954 ms = kmalloc(len, GFP_KERNEL); 954 ms = kzalloc(len, GFP_KERNEL);
955 if (!ms) { 955 if (!ms) {
956 ti->error = "Cannot allocate mirror context"; 956 ti->error = "Cannot allocate mirror context";
957 return NULL; 957 return NULL;
958 } 958 }
959 959
960 memset(ms, 0, len);
961 spin_lock_init(&ms->lock); 960 spin_lock_init(&ms->lock);
962 961
963 ms->ti = ti; 962 ms->ti = ti;