spi: mpc512x: fix reference leak to master in mpc512x_psc_spi_do_remove()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 15 Nov 2013 07:48:56 +0000 (15:48 +0800)
committerMark Brown <broonie@linaro.org>
Fri, 15 Nov 2013 10:29:38 +0000 (10:29 +0000)
commita4469a429fc71af6bad9c9e3f7307249dedfe8d1
tree85e93a5aea395af995b8aceb7acfb2647a078ef3
parent82f85cf98f0eb60093e8b3d606711c2d49538478
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>
drivers/spi/spi-mpc512x-psc.c