dm: add missing del_gendisk to alloc_dev error path
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 16 Oct 2009 22:18:15 +0000 (23:18 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Fri, 16 Oct 2009 22:18:15 +0000 (23:18 +0100)
commit03022c54b9725026c0370a810168975c387ad04c
tree3d16ed7e303effca715f0ea78f022252f48e1257
parentbca915aae803cf01fde4461fc9c093cf5a86d7fc
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>
drivers/md/dm.c