summaryrefslogtreecommitdiff
path: root/block/partitions
diff options
context:
space:
mode:
Diffstat (limited to 'block/partitions')
-rw-r--r--block/partitions/core.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c
index bcfa8215bd5e..8924e1ea8b2a 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -409,14 +409,9 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno,
if (!p)
return ERR_PTR(-EBUSY);
- err = -ENOMEM;
- p->dkstats = alloc_percpu(struct disk_stats);
- if (!p->dkstats)
- goto out_free;
-
bdev = bdev_alloc(disk, partno);
if (!bdev)
- goto out_free_stats;
+ goto out_free;
p->bdev = bdev;
pdev = part_to_dev(p);
@@ -490,8 +485,6 @@ out_free_info:
kfree(p->info);
out_bdput:
bdput(bdev);
-out_free_stats:
- free_percpu(p->dkstats);
out_free:
kfree(p);
return ERR_PTR(err);