Add missing del_gendisk to error path
PATCH 1/1 Add missing del_gendisk to 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'
Signed-off-by Zdenek Kabelac <[email protected]>
--- drivers/md/dm.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/md/dm.c +1 -0
@@ -1819,6 +1819,7 @@ static struct mapped_device *alloc_dev(int minor) bad_bdev:destroy_workqueue (md->wq); bad_thread: +del_gendisk (md->disk);put_disk (md->disk); bad_disk:blk_cleanup_queue (md->queue);
Reviewed-by Jonathan Brassow <[email protected]>
brassow
Quoted 30 lines · Zdenek Kabelac
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'
Signed-off-by Zdenek Kabelac <[email protected]>---
drivers/md/dm.c| 1 +1 files changed, 1 insertions(+), 0 deletions(-)drivers/md/dm.c +0
-0@@ -1819,6 +1819,7 @@ static struct mapped_device *alloc_dev(int minor)
bad_bdev:destroy_workqueue(md->wq);
bad_thread:drivers/md/dm.c +1
-0+del_gendisk (md->disk);put_disk(md->disk); bad_disk: blk_cleanup_queue(md->queue);--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel