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: eaa2429784 ('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>
This commit is contained in:
Wei Yongjun 2013-11-15 15:48:56 +08:00 committed by Mark Brown
parent 82f85cf98f
commit a4469a429f

View file

@ -556,7 +556,7 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
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);