public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] block: fix add_partition() error path
@ 2008-11-10  6:28 Tejun Heo
  2008-11-10  6:29 ` [PATCH] block: make add_partition() return pointer to hd_struct Tejun Heo
  2008-11-10 12:41 ` [PATCH 1/3] block: fix add_partition() error path Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Tejun Heo @ 2008-11-10  6:28 UTC (permalink / raw)
  To: Jens Axboe, Linux Kernel

Partition stats structure was not freed on devt allocation failure
path.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 fs/partitions/check.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: work/fs/partitions/check.c
===================================================================
--- work.orig/fs/partitions/check.c
+++ work/fs/partitions/check.c
@@ -395,7 +395,7 @@ int add_partition(struct gendisk *disk,
 
 	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,
 
 	return 0;
 
+out_free_stats:
+	free_part_stats(p);
 out_free:
 	kfree(p);
 	return err;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-10 12:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10  6:28 [PATCH 1/3] block: fix add_partition() error path Tejun Heo
2008-11-10  6:29 ` [PATCH] block: make add_partition() return pointer to hd_struct Tejun Heo
2008-11-10  6:30   ` [PATCH 3/3] block/md: fix md autodetection Tejun Heo
2008-11-10 12:41 ` [PATCH 1/3] block: fix add_partition() error path Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox