From: Tejun Heo Date: Mon, 10 Nov 2008 06:28:59 +0000 (+0900) Subject: block: fix add_partition() error path X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eb60fa1066622ddb2278732cf61e0c4544e82c6f;p=linux-beck.git block: fix add_partition() error path Partition stats structure was not freed on devt allocation failure path. Fix it. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe --- 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;