summaryrefslogtreecommitdiff
path: root/fs/partitions
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-11-10 09:28:59 +0300
committerJens Axboe <jens.axboe@oracle.com>2008-11-18 17:08:55 +0300
commiteb60fa1066622ddb2278732cf61e0c4544e82c6f (patch)
tree4297d3c2e8876897c51843df148725909a356a08 /fs/partitions
parent4e14e833ac3b97a4aa8803eea49f899adc5bb5f4 (diff)
downloadlinux-eb60fa1066622ddb2278732cf61e0c4544e82c6f.tar.xz
block: fix add_partition() error path
Partition stats structure was not freed on devt allocation failure path. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/partitions')
-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 633f7a0ebb2c..90bcf136a9de 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;