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:16:49 +0000 (11:16 -0800)
commit0915f56236d98fe73ba35fc03e00d1c76404cb8b
treede742db433fcccfe129e1ba316b6b5de9b9e268d
parent81301a15a267ba132c07e01c70d5fbe91069bdfb
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