memstick: ms_block: Add error handling support for add_disk()
authorLuis Chamberlain <mcgrof@kernel.org>
Thu, 2 Sep 2021 17:40:58 +0000 (10:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:17 +0000 (13:14 +0100)
commitb77ced3fce5c54495000a4308b0bc3e6e20f6555
treedee230adc923a851bc74c0b69648e9029522beb8
parentae00eb67792b63efc20b00517fae2aed1a3d4427
memstick: ms_block: Add error handling support for add_disk()

[ Upstream commit 2304c55fd506fcd5e1a59ae21a306ee82507340b ]

We never checked for errors on add_disk() as this function returned void.
Now that this is fixed, use the shiny new error handling.

Contrary to the typical removal which delays the put_disk() until later,
since we are failing on a probe we immediately put the disk on failure from
add_disk by using blk_cleanup_disk().

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20210902174105.2418771-3-mcgrof@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Stable-dep-of: 4f431a047a5c ("memstick/ms_block: Add check for alloc_ordered_workqueue")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memstick/core/ms_block.c