ataflop: fix error handling during setup
authorOmar Sandoval <osandov@fb.com>
Thu, 11 Oct 2018 19:20:49 +0000 (12:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:14:51 +0000 (11:14 -0800)
commit7084b74ffc246e781c77a963321f34b661ea49cc
tree79b16a4630ce37d9e17b8fd397732b69b486831b
parent5cf2ab06e8d0d7c9ca15f51eeed67103a973725f
ataflop: fix error handling during setup

[ Upstream commit 71327f547ee3a46ec5c39fdbbd268401b2578d0e ]

Move queue allocation next to disk allocation to fix a couple of issues:

- If add_disk() hasn't been called, we should clear disk->queue before
  calling put_disk().
- If we fail to allocate a request queue, we still need to put all of
  the disks, not just the ones that we allocated queues for.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/ataflop.c