diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2009-10-16 18:18:15 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-10-16 18:18:15 -0400 |
commit | 03022c54b9725026c0370a810168975c387ad04c (patch) | |
tree | 3d16ed7e303effca715f0ea78f022252f48e1257 /drivers/md/dm.c | |
parent | bca915aae803cf01fde4461fc9c093cf5a86d7fc (diff) |
dm: add missing del_gendisk to alloc_dev error path
Add missing del_gendisk() to error path when creation of workqueue fails.
Otherwice there is a resource leak and following warning is shown:
WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0xc5/0x160()
sysfs: cannot create duplicate filename '/devices/virtual/block/dm-0'
Cc: stable@kernel.org
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 376f1ab48a24..c5f9918dab24 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1822,6 +1822,7 @@ static struct mapped_device *alloc_dev(int minor) | |||
1822 | bad_bdev: | 1822 | bad_bdev: |
1823 | destroy_workqueue(md->wq); | 1823 | destroy_workqueue(md->wq); |
1824 | bad_thread: | 1824 | bad_thread: |
1825 | del_gendisk(md->disk); | ||
1825 | put_disk(md->disk); | 1826 | put_disk(md->disk); |
1826 | bad_disk: | 1827 | bad_disk: |
1827 | blk_cleanup_queue(md->queue); | 1828 | blk_cleanup_queue(md->queue); |