diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-11-15 15:48:56 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-15 10:29:38 +0000 |
commit | a4469a429fc71af6bad9c9e3f7307249dedfe8d1 (patch) | |
tree | 85e93a5aea395af995b8aceb7acfb2647a078ef3 /drivers/spi | |
parent | 82f85cf98f0eb60093e8b3d606711c2d49538478 (diff) | |
download | linux-a4469a429fc71af6bad9c9e3f7307249dedfe8d1.tar.bz2 |
spi: mpc512x: fix reference leak to master in mpc512x_psc_spi_do_remove()
Once a spi_master_get() call succeeds, we need an additional
spi_master_put() call to free the memory, otherwise we will
leak a reference to master. Fix by removing the unnecessary
spi_master_get() call.
Fixes: eaa24297846b ('spi: mpc512x: use devm_spi_register_master()')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-mpc512x-psc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index ee6e61cbf7f5..e9f22a802cdb 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -556,7 +556,7 @@ free_master: static int mpc512x_psc_spi_do_remove(struct device *dev) { - struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); + struct spi_master *master = dev_get_drvdata(dev); struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); clk_disable_unprepare(mps->clk_mclk); |