diff options
-rw-r--r-- | drivers/md/dm-mpath.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d1dc72c0f98a..d754e0bc6e90 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -114,12 +114,10 @@ static void trigger_event(void *data); | |||
114 | 114 | ||
115 | static struct pgpath *alloc_pgpath(void) | 115 | static struct pgpath *alloc_pgpath(void) |
116 | { | 116 | { |
117 | struct pgpath *pgpath = kmalloc(sizeof(*pgpath), GFP_KERNEL); | 117 | struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL); |
118 | 118 | ||
119 | if (pgpath) { | 119 | if (pgpath) |
120 | memset(pgpath, 0, sizeof(*pgpath)); | ||
121 | pgpath->path.is_active = 1; | 120 | pgpath->path.is_active = 1; |
122 | } | ||
123 | 121 | ||
124 | return pgpath; | 122 | return pgpath; |
125 | } | 123 | } |
@@ -133,12 +131,10 @@ static struct priority_group *alloc_priority_group(void) | |||
133 | { | 131 | { |
134 | struct priority_group *pg; | 132 | struct priority_group *pg; |
135 | 133 | ||
136 | pg = kmalloc(sizeof(*pg), GFP_KERNEL); | 134 | pg = kzalloc(sizeof(*pg), GFP_KERNEL); |
137 | if (!pg) | ||
138 | return NULL; | ||
139 | 135 | ||
140 | memset(pg, 0, sizeof(*pg)); | 136 | if (pg) |
141 | INIT_LIST_HEAD(&pg->pgpaths); | 137 | INIT_LIST_HEAD(&pg->pgpaths); |
142 | 138 | ||
143 | return pg; | 139 | return pg; |
144 | } | 140 | } |
@@ -172,9 +168,8 @@ static struct multipath *alloc_multipath(struct dm_target *ti) | |||
172 | { | 168 | { |
173 | struct multipath *m; | 169 | struct multipath *m; |
174 | 170 | ||
175 | m = kmalloc(sizeof(*m), GFP_KERNEL); | 171 | m = kzalloc(sizeof(*m), GFP_KERNEL); |
176 | if (m) { | 172 | if (m) { |
177 | memset(m, 0, sizeof(*m)); | ||
178 | INIT_LIST_HEAD(&m->priority_groups); | 173 | INIT_LIST_HEAD(&m->priority_groups); |
179 | spin_lock_init(&m->lock); | 174 | spin_lock_init(&m->lock); |
180 | m->queue_io = 1; | 175 | m->queue_io = 1; |