]> git.baikalelectronics.ru Git - kernel.git/commit
spi: lpspi: fix memory leak in fsl_lpspi_probe
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Mon, 30 Sep 2019 03:46:01 +0000 (22:46 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 1 Oct 2019 17:39:12 +0000 (18:39 +0100)
commita1281fd63a51e22e4f34c676a9bb4ba4db5ccc7e
tree3eced86d3ef37df84a2cf7c36a7907275d5c91e1
parentc58b01cca57ccb8ed7b9a4b51cdacca3b77d350e
spi: lpspi: fix memory leak in fsl_lpspi_probe

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: f108a5cd3c6b ("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>
drivers/spi/spi-fsl-lpspi.c