summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/partitions/check.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 633f7a0ebb2..90bcf136a9d 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -395,7 +395,7 @@ int add_partition(struct gendisk *disk, int partno,
err = blk_alloc_devt(p, &devt);
if (err)
- goto out_free;
+ goto out_free_stats;
pdev->devt = devt;
/* delay uevent until 'holders' subdir is created */
@@ -426,6 +426,8 @@ int add_partition(struct gendisk *disk, int partno,
return 0;
+out_free_stats:
+ free_part_stats(p);
out_free:
kfree(p);
return err;