aboutsummaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 863a8c0623ed..b321cadd6e65 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -726,21 +726,21 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
726{ 726{
727 struct gendisk *disk; 727 struct gendisk *disk;
728 728
729 disk = kmalloc_node(sizeof(struct gendisk), GFP_KERNEL, node_id); 729 disk = kmalloc_node(sizeof(struct gendisk),
730 GFP_KERNEL | __GFP_ZERO, node_id);
730 if (disk) { 731 if (disk) {
731 memset(disk, 0, sizeof(struct gendisk));
732 if (!init_disk_stats(disk)) { 732 if (!init_disk_stats(disk)) {
733 kfree(disk); 733 kfree(disk);
734 return NULL; 734 return NULL;
735 } 735 }
736 if (minors > 1) { 736 if (minors > 1) {
737 int size = (minors - 1) * sizeof(struct hd_struct *); 737 int size = (minors - 1) * sizeof(struct hd_struct *);
738 disk->part = kmalloc_node(size, GFP_KERNEL, node_id); 738 disk->part = kmalloc_node(size,
739 GFP_KERNEL | __GFP_ZERO, node_id);
739 if (!disk->part) { 740 if (!disk->part) {
740 kfree(disk); 741 kfree(disk);
741 return NULL; 742 return NULL;
742 } 743 }
743 memset(disk->part, 0, size);
744 } 744 }
745 disk->minors = minors; 745 disk->minors = minors;
746 kobj_set_kset_s(disk,block_subsys); 746 kobj_set_kset_s(disk,block_subsys);