Unverified Commit 9b844b08 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown
Browse files

spi: dln2: Fix reference leak to master



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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210409082955.2907950-1-weiyongjun1@huawei.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5fed9fe5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -781,7 +781,7 @@ static int dln2_spi_probe(struct platform_device *pdev)

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);