Skip to content

Commit

Permalink
spi: txx9: fix reference leak to master in txx9spi_remove()
Browse files Browse the repository at this point in the history
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: 2fe7e4a ('spi: txx9: use devm_spi_register_master()')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Wei Yongjun authored and Mark Brown committed Nov 15, 2013
1 parent 82f85cf commit b38f87e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-txx9.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static int txx9spi_probe(struct platform_device *dev)

static int txx9spi_remove(struct platform_device *dev)
{
struct spi_master *master = spi_master_get(platform_get_drvdata(dev));
struct spi_master *master = platform_get_drvdata(dev);
struct txx9spi *c = spi_master_get_devdata(master);

destroy_workqueue(c->workqueue);
Expand Down

0 comments on commit b38f87e

Please sign in to comment.