WSL2-Linux-Kernel/drivers/mmc
Yang Yingliang ecad2fafd4 mmc: mmc_spi: fix error handling in mmc_spi_probe()
commit cf4c9d2ac1 upstream.

If mmc_add_host() fails, it doesn't need to call mmc_remove_host(),
or it will cause null-ptr-deref, because of deleting a not added
device in mmc_remove_host().

To fix this, goto label 'fail_glue_init', if mmc_add_host() fails,
and change the label 'fail_add_host' to 'fail_gpiod_request'.

Fixes: 15a0580ced ("mmc_spi host driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230131013835.3564011-1-yangyingliang@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-22 12:57:06 +01:00
..
core mmc: sdio: fix possible resource leaks in some error paths 2023-02-22 12:57:06 +01:00
host mmc: mmc_spi: fix error handling in mmc_spi_probe() 2023-02-22 12:57:06 +01:00
Kconfig
Makefile