aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNavid Emamdoost <navid.emamdoost@gmail.com>2019-09-29 22:46:01 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2019-12-02 14:07:29 -0500
commit3fe8e6c9095c14725ace3562f73e5b59de0daa50 (patch)
tree451b98b5e2a646dbddda1976baf3c75aaad51883
parent7d0bf52f1adbc90f4ad0ea9016547d4703fe6be9 (diff)
downloadlinux-yocto-3fe8e6c9095c14725ace3562f73e5b59de0daa50.tar.gz
linux-yocto-3fe8e6c9095c14725ace3562f73e5b59de0daa50.tar.bz2
linux-yocto-3fe8e6c9095c14725ace3562f73e5b59de0daa50.zip
spi: lpspi: fix memory leak in fsl_lpspi_probe
commit 057b8945f78f76d0b04eeb5c27cd9225e5e7ad86 upstream. In fsl_lpspi_probe an SPI controller is allocated either via spi_alloc_slave or spi_alloc_master. In all but one error cases this controller is put by going to error handling code. This commit fixes the case when pm_runtime_get_sync fails and it should go to the error handling path. Fixes: 944c01a889d9 ("spi: lpspi: enable runtime pm for lpspi") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Link: https://lore.kernel.org/r/20190930034602.1467-1-navid.emamdoost@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--drivers/spi/spi-fsl-lpspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index d08e9324140e..3528ed5eea9b 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -938,7 +938,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(fsl_lpspi->dev);
if (ret < 0) {
dev_err(fsl_lpspi->dev, "failed to enable clock\n");
- return ret;
+ goto out_controller_put;
}
temp = readl(fsl_lpspi->base + IMX7ULP_PARAM);