diff options
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r-- | drivers/md/multipath.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 145cdc5ad008..97a56aaaef6d 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -41,9 +41,7 @@ static mdk_personality_t multipath_personality; | |||
41 | static void *mp_pool_alloc(gfp_t gfp_flags, void *data) | 41 | static void *mp_pool_alloc(gfp_t gfp_flags, void *data) |
42 | { | 42 | { |
43 | struct multipath_bh *mpb; | 43 | struct multipath_bh *mpb; |
44 | mpb = kmalloc(sizeof(*mpb), gfp_flags); | 44 | mpb = kzalloc(sizeof(*mpb), gfp_flags); |
45 | if (mpb) | ||
46 | memset(mpb, 0, sizeof(*mpb)); | ||
47 | return mpb; | 45 | return mpb; |
48 | } | 46 | } |
49 | 47 | ||
@@ -444,7 +442,7 @@ static int multipath_run (mddev_t *mddev) | |||
444 | * should be freed in multipath_stop()] | 442 | * should be freed in multipath_stop()] |
445 | */ | 443 | */ |
446 | 444 | ||
447 | conf = kmalloc(sizeof(multipath_conf_t), GFP_KERNEL); | 445 | conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL); |
448 | mddev->private = conf; | 446 | mddev->private = conf; |
449 | if (!conf) { | 447 | if (!conf) { |
450 | printk(KERN_ERR | 448 | printk(KERN_ERR |
@@ -452,9 +450,8 @@ static int multipath_run (mddev_t *mddev) | |||
452 | mdname(mddev)); | 450 | mdname(mddev)); |
453 | goto out; | 451 | goto out; |
454 | } | 452 | } |
455 | memset(conf, 0, sizeof(*conf)); | ||
456 | 453 | ||
457 | conf->multipaths = kmalloc(sizeof(struct multipath_info)*mddev->raid_disks, | 454 | conf->multipaths = kzalloc(sizeof(struct multipath_info)*mddev->raid_disks, |
458 | GFP_KERNEL); | 455 | GFP_KERNEL); |
459 | if (!conf->multipaths) { | 456 | if (!conf->multipaths) { |
460 | printk(KERN_ERR | 457 | printk(KERN_ERR |
@@ -462,7 +459,6 @@ static int multipath_run (mddev_t *mddev) | |||
462 | mdname(mddev)); | 459 | mdname(mddev)); |
463 | goto out_free_conf; | 460 | goto out_free_conf; |
464 | } | 461 | } |
465 | memset(conf->multipaths, 0, sizeof(struct multipath_info)*mddev->raid_disks); | ||
466 | 462 | ||
467 | conf->working_disks = 0; | 463 | conf->working_disks = 0; |
468 | ITERATE_RDEV(mddev,rdev,tmp) { | 464 | ITERATE_RDEV(mddev,rdev,tmp) { |