block/ataflop: add registration bool before calling del_gendisk()
authorLuis Chamberlain <mcgrof@kernel.org>
Mon, 27 Sep 2021 22:03:00 +0000 (15:03 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 20:41:37 +0000 (14:41 -0600)
commit573effb298011d3fcabc9b12025cf637f8a07911
tree3d6ee6512b4c34654bd40c68002f7ce952499bb1
parent44a469b6acae6ad05c4acca8429467d1d50a8b8d
block/ataflop: add registration bool before calling del_gendisk()

The ataflop assumes del_gendisk() is safe to call, this is only
true because add_disk() does not return a failure, but that will
change soon. And so, before we get to adding error handling for
that case, let's make sure we keep track of which disks actually
get registered. Then we use this to only call del_gendisk for them.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20210927220302.1073499-13-mcgrof@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ataflop.c