mmc: block: Add error handling support for add_disk()
authorLuis Chamberlain <mcgrof@kernel.org>
Mon, 30 Aug 2021 21:25:34 +0000 (14:25 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 12 Oct 2021 08:21:16 +0000 (10:21 +0200)
commit9c1aaec47527816877befb7f18ea1cf25e55b8c8
treec5079282877bac7c31d6e239a814dcd226b23218
parentd74179b86925165562aec81e0ba269ebc453dad2
mmc: block: Add error handling support for add_disk()

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

The caller only cleanups the disk if we pass on an allocated md but on
error we return return ERR_PTR(ret), and so we must do all the unwinding
ourselves.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20210830212538.148729-5-mcgrof@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/block.c