]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 10:04:39 +0000 (11:04 +0100)
commit4f6264ed34b69da329d0c681701e6ebe12c381b1
tree843bf38852bc481c4f58927f887f7fda81a44806
parentff8f1a821132067b0798fecfb6d67329be3948ad
block/ataflop: add registration bool before calling del_gendisk()

[ Upstream commit 573effb298011d3fcabc9b12025cf637f8a07911 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/ataflop.c