linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-07 11:55 Wei Yongjun
  2020-05-08 17:14 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Wei Yongjun @ 2020-05-07 11:55 UTC (permalink / raw)
  To: Sanjay R Mehta, Mark Brown
  Cc: Wei Yongjun, linux-spi, kernel-janitors, Hulk Robot

The call to spi_master_put() in amd_spi_remove() is redundant and
may causes user after free since the master have been freed by
spi_unregister_master(), so remove it.

Fixes: bbb336f39efc ("spi: spi-amd: Add AMD SPI controller driver support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/spi/spi-amd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index c7cfc3dc20b1..e5e767ba5823 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -304,7 +304,6 @@ static int amd_spi_remove(struct platform_device *pdev)
 	struct amd_spi *amd_spi = platform_get_drvdata(pdev);
 
 	spi_unregister_master(amd_spi->master);
-	spi_master_put(amd_spi->master);
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-12  1:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 11:55 [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove() Wei Yongjun
2020-05-08 17:14 ` Mark Brown
2020-05-08 17:53 ` Mark Brown
2020-05-11 17:21 ` Mark Brown
2020-05-11 17:29   ` Mark Brown
2020-05-12  1:22     ` Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).