linux/drivers/mmc/host
Yang Yingliang 82645bf4ed 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:59:48 +01:00
..
alcor.c mmc: alcor: fix return value check of mmc_add_host() 2022-12-31 13:32:23 +01:00
atmel-mci.c mmc: atmel-mci: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
au1xmmc.c
bcm2835.c
cavium-octeon.c
cavium-thunderx.c
cavium.c
cavium.h
cb710-mmc.c
cb710-mmc.h
cqhci-core.c
cqhci-crypto.c
cqhci-crypto.h
cqhci.h
davinci_mmc.c
dw_mmc-bluefield.c
dw_mmc-exynos.c
dw_mmc-exynos.h
dw_mmc-hi3798cv200.c
dw_mmc-k3.c
dw_mmc-pci.c
dw_mmc-pltfm.c
dw_mmc-pltfm.h
dw_mmc-rockchip.c
dw_mmc.c
dw_mmc.h
jz4740_mmc.c mmc: jz4740: Work around bug on JZ4760(B) 2023-02-22 12:59:47 +01:00
Kconfig mmc: sdhci_am654: 'select', not 'depends' REGMAP_MMIO 2022-10-26 11:48:03 +02:00
litex_mmc.c mmc: litex_mmc: ensure host->irq == 0 if polling 2022-12-31 13:32:24 +01:00
Makefile
meson-gx-mmc.c mmc: meson-gx: fix SDIO mode if cap_sdio_irq isn't set 2023-02-22 12:59:47 +01:00
meson-mx-sdhc-clkc.c
meson-mx-sdhc-mmc.c
meson-mx-sdhc.h
meson-mx-sdio.c
mmc_hsq.c
mmc_hsq.h
mmc_spi.c mmc: mmc_spi: fix error handling in mmc_spi_probe() 2023-02-22 12:59:48 +01:00
mmci_qcom_dml.c
mmci_stm32_sdmmc.c
mmci.c mmc: mmci: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
mmci.h
moxart-mmc.c mmc: moxart: fix return value check of mmc_add_host() 2022-12-31 13:32:23 +01:00
mtk-sd.c mmc: mtk-sd: Fix missing clk_disable_unprepare in msdc_of_clock_parse() 2022-11-29 13:26:06 +01:00
mvsdio.c
mvsdio.h
mxcmmc.c mmc: mxcmmc: fix return value check of mmc_add_host() 2022-12-31 13:32:23 +01:00
mxs-mmc.c
of_mmc_spi.c
omap_hsmmc.c mmc: omap_hsmmc: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
omap.c
owl-mmc.c
pxamci.c mmc: pxamci: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
pxamci.h
renesas_sdhi_core.c mmc: renesas_sdhi: better reset from HS400 mode 2022-12-31 13:33:04 +01:00
renesas_sdhi_internal_dmac.c mmc: renesas_sdhi: add quirk for broken register layout 2022-12-31 13:33:04 +01:00
renesas_sdhi_sys_dmac.c
renesas_sdhi.h mmc: renesas_sdhi: add quirk for broken register layout 2022-12-31 13:33:04 +01:00
rtsx_pci_sdmmc.c mmc: rtsx_pci: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
rtsx_usb_sdmmc.c mmc: rtsx_usb_sdmmc: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
s3cmci.c
s3cmci.h
sdhci_am654.c mmc: sdhci_am654: Fix SDHCI_RESET_ALL for CQHCI 2022-11-07 13:33:43 +01:00
sdhci_f_sdh30.c mmc: f-sdh30: Add quirks for broken timeout clock capability 2022-12-31 13:33:04 +01:00
sdhci_f_sdh30.h
sdhci-acpi.c
sdhci-bcm-kona.c
sdhci-brcmstb.c mmc: sdhci-brcmstb: Fix SDHCI_RESET_ALL for CQHCI 2022-11-07 13:33:09 +01:00
sdhci-cadence.c
sdhci-cns3xxx.c
sdhci-cqhci.h mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI 2022-11-07 13:28:47 +01:00
sdhci-dove.c
sdhci-esdhc-imx.c mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting 2023-01-24 07:24:35 +01:00
sdhci-esdhc-mcf.c
sdhci-esdhc.h
sdhci-iproc.c
sdhci-milbeaut.c
sdhci-msm.c
sdhci-of-arasan.c mmc: sdhci-of-arasan: Fix SDHCI_RESET_ALL for CQHCI 2022-11-07 13:28:47 +01:00
sdhci-of-aspeed-test.c
sdhci-of-aspeed.c
sdhci-of-at91.c
sdhci-of-dwcmshc.c
sdhci-of-esdhc.c
sdhci-of-hlwd.c
sdhci-of-sparx5.c
sdhci-omap.c
sdhci-pci-arasan.c
sdhci-pci-core.c mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() 2022-11-16 17:00:39 +01:00
sdhci-pci-dwc-mshc.c
sdhci-pci-gli.c
sdhci-pci-o2micro.c mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout 2022-11-16 13:58:55 +01:00
sdhci-pci.h
sdhci-pic32.c
sdhci-pltfm.c
sdhci-pltfm.h
sdhci-pxav2.c
sdhci-pxav3.c
sdhci-s3c.c
sdhci-spear.c
sdhci-sprd.c mmc: sdhci-sprd: Disable CLK_AUTO when the clock is less than 400K 2023-01-07 11:11:37 +01:00
sdhci-st.c
sdhci-tegra.c mmc: sdhci-tegra: Issue CMD and DAT resets together 2022-12-31 13:33:04 +01:00
sdhci-xenon-phy.c
sdhci-xenon.c
sdhci-xenon.h
sdhci.c mmc: sdhci-tegra: Issue CMD and DAT resets together 2022-12-31 13:33:04 +01:00
sdhci.h mmc: sdhci-tegra: Issue CMD and DAT resets together 2022-12-31 13:33:04 +01:00
sdricoh_cs.c
sh_mmcif.c
sunxi-mmc.c mmc: sunxi-mmc: Fix clock refcount imbalance during unbind 2023-01-24 07:24:35 +01:00
tifm_sd.c
tmio_mmc_core.c
tmio_mmc.c
tmio_mmc.h
toshsd.c mmc: toshsd: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
toshsd.h
uniphier-sd.c
usdhi6rol0.c
ushc.c
via-sdmmc.c mmc: via-sdmmc: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
vub300.c mmc: vub300: fix warning - do not call blocking ops when !TASK_RUNNING 2023-01-04 11:29:02 +01:00
wbsd.c mmc: wbsd: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00
wbsd.h
wmt-sdmmc.c mmc: wmt-sdmmc: fix return value check of mmc_add_host() 2022-12-31 13:32:24 +01:00