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: NVivek Goyal <vgoyal@redhat.com> Reviewed-by: NBen Hutchings <ben@decadent.org.uk> Signed-off-by: NHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz> Signed-off-by: NJens Axboe <axboe@kernel.dk>
Showing
想要评论请 注册 或 登录