OSDN Git Service

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>
Wed, 21 Nov 2018 08:27:31 +0000 (09:27 +0100)
commit7d81f8fe5427ebe7d5ea8cd526c77fee9c01a7c3
tree7cb081de29ab28f03da5889b57c453005413a1c3
parentef42ef8451faae09fe3a0b00c603ceeda8f5f5c5
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