aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIshai Rabinovitz <ishai@mellanox.co.il>2006-10-03 04:15:22 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:14 -0400
commite3f6ac6123be6f4ba14d71af0da0e8d3d39c33ed (patch)
tree7b3924ea9e382e090ac31ed87b7d99ca9ca9cd70
parente90dae1f58d475b71bcc4eebf6d4fd5217ed85c7 (diff)
[PATCH] dm: fix alloc_dev error path
While reading the code I found a bug in the error path in alloc_dev in dm.c When blk_alloc_queue fails there is no call to free_minor. This patch fixes the problem. Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/md/dm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 5792686936c1..81717e273327 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -943,7 +943,7 @@ static struct mapped_device *alloc_dev(int minor)
943 943
944 md->queue = blk_alloc_queue(GFP_KERNEL); 944 md->queue = blk_alloc_queue(GFP_KERNEL);
945 if (!md->queue) 945 if (!md->queue)
946 goto bad1; 946 goto bad1_free_minor;
947 947
948 md->queue->queuedata = md; 948 md->queue->queuedata = md;
949 md->queue->backing_dev_info.congested_fn = dm_any_congested; 949 md->queue->backing_dev_info.congested_fn = dm_any_congested;
@@ -993,6 +993,7 @@ static struct mapped_device *alloc_dev(int minor)
993 mempool_destroy(md->io_pool); 993 mempool_destroy(md->io_pool);
994 bad2: 994 bad2:
995 blk_cleanup_queue(md->queue); 995 blk_cleanup_queue(md->queue);
996 bad1_free_minor:
996 free_minor(minor); 997 free_minor(minor);
997 bad1: 998 bad1:
998 module_put(THIS_MODULE); 999 module_put(THIS_MODULE);