summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-dln2.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2021-04-09 08:29:55 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-22 10:38:17 +0200
commit2106b5c9df50ff9f0dcec09d4800dcecbb2720bd (patch)
treec15c186a1f5638ee919a419003b9df8290312c83 /drivers/spi/spi-dln2.c
parent95f98ee1b46d470554abdee020c0740bcfff44a1 (diff)
spi: dln2: Fix reference leak to master
[ Upstream commit 9b844b087124c1538d05f40fda8a4fec75af55be ] Call spi_master_get() holds the reference count to master device, thus we need an additional spi_master_put() call to reduce the reference count, otherwise we will leak a reference to master. This commit fix it by removing the unnecessary spi_master_get(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20210409082955.2907950-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dln2.c')
-rw-r--r--drivers/spi/spi-dln2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c
index 3b7d91d94fea..64b64174ce2f 100644
--- a/drivers/spi/spi-dln2.c
+++ b/drivers/spi/spi-dln2.c
@@ -781,7 +781,7 @@ exit_free_master:
static int dln2_spi_remove(struct platform_device *pdev)
{
- struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
+ struct spi_master *master = platform_get_drvdata(pdev);
struct dln2_spi *dln2 = spi_master_get_devdata(master);
pm_runtime_disable(&pdev->dev);