projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
282ede7
)
mmc: alcor: Fix a resource leak in the error path for ->probe()
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Sun, 26 Apr 2020 20:23:55 +0000
(22:23 +0200)
committer
Ulf Hansson
<ulf.hansson@linaro.org>
Thu, 7 May 2020 13:10:25 +0000
(15:10 +0200)
If devm_request_threaded_irq() fails, the allocated struct mmc_host needs
to be freed via calling mmc_free_host(), so let's do that.
Fixes:
c5413ad815a6
("mmc: add new Alcor Micro Cardreader SD/MMC driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link:
https://lore.kernel.org/r/20200426202355.43055-1-christophe.jaillet@wanadoo.fr
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/alcor.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/host/alcor.c
b/drivers/mmc/host/alcor.c
index
1aee485
..
026ca91
100644
(file)
--- a/
drivers/mmc/host/alcor.c
+++ b/
drivers/mmc/host/alcor.c
@@
-1104,7
+1104,7
@@
static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev, "Failed to get irq for data line\n");
-
return re
t;
+
goto free_hos
t;
}
mutex_init(&host->cmd_mutex);
@@
-1116,6
+1116,10
@@
static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, host);
mmc_add_host(mmc);
return 0;
+
+free_host:
+ mmc_free_host(mmc);
+ return ret;
}
static int alcor_pci_sdmmc_drv_remove(struct platform_device *pdev)