Skip to content
Commit b54e1f88 authored by Herton Ronaldo Krzesinski's avatar Herton Ronaldo Krzesinski Committed by Jens Axboe
Browse files

floppy: don't call alloc_ordered_workqueue inside the alloc_disk loop



Since commit 070ad7e7 ("floppy: convert to delayed work and single-thread
wq"), we end up calling alloc_ordered_workqueue multiple times inside
the loop, which shouldn't be intended. Besides the leak, other side
effect in the current code is if blk_init_queue fails, we would end up
calling unregister_blkdev even if we didn't call yet register_blkdev.

Just moved the allocation of floppy_wq before the loop, and adjusted the
code accordingly.

Cc: stable@vger.kernel.org # 3.5+
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Reviewed-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2911758f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment