Skip to contentSkip to conversation

dm: fix alloc_dev error path

PATCH In review Alasdair G Kergon 2 participants 3 messages Sep 14, 2006 – Sep 29, 2006 Device mapper

lore
Share & tools
lore

Alasdair G Kergon

author maintainer
#0 lore raw

PATCH 1/25 dm: fix alloc_dev error path

From: Ishai Rabinovitz <[email protected]>

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.

drivers/md/dm.c +2 -1
Index: linux-2.6.18-rc7/drivers/md/dm.c
===================================================================
@@ -943,7 +943,7 @@ static struct mapped_device *alloc_dev(i
 
 	md->queue = blk_alloc_queue(GFP_KERNEL);
 	if (!md->queue)
-		goto bad1;
+		goto bad1_free_minor;
 
 	md->queue->queuedata = md;
 	md->queue->backing_dev_info.congested_fn = dm_any_congested;
@@ -993,6 +993,7 @@ static struct mapped_device *alloc_dev(i
 	mempool_destroy(md->io_pool);
  bad2:
 	blk_cleanup_queue(md->queue);
+ bad1_free_minor:
 	free_minor(minor);
  bad1:
 	module_put(THIS_MODULE);
#1 lore raw

So how come these patches aren't also posted to the linux-lvm mailing list as well?

John

author maintainer
#2 lore raw
Quoted 2 lines · John Stoffel

So how come these patches aren't also posted to the linux-lvm mailing list as well?

device-mapper patches are discussed on the dm-devel mailing list.

We have discussed the usage of the various mailing lists at the device-mapper/lvm2 summit here in Germany this week and one decision was always to Cc:dm-devel on such patches at submission stage in future. (Usually they been on that list already, prior to submission.)

Alasdair

Signature · 1 line
[email protected]