linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 1/2] spi: microchip-core: fix UAF in mchp_corespi_remove()
@ 2022-07-12 13:53 Yang Yingliang
  2022-07-12 13:53 ` [PATCH -next 2/2] spi: microchip-core: switch to use devm_spi_alloc_master() Yang Yingliang
  2022-07-12 20:52 ` [PATCH -next 1/2] spi: microchip-core: fix UAF in mchp_corespi_remove() Conor.Dooley
  0 siblings, 2 replies; 6+ messages in thread
From: Yang Yingliang @ 2022-07-12 13:53 UTC (permalink / raw)
  To: linux-kernel, linux-spi, linux-riscv
  Cc: conor.dooley, daire.mcnamara, broonie

When using devm_spi_register_master(), the unregister function will
be called in devres_release_all() which is called after ->remove(),
so remove spi_unregister_master() andspi_master_put().

Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/spi/spi-microchip-core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index b3083075cd36..c26767343176 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -595,8 +595,6 @@ static int mchp_corespi_remove(struct platform_device *pdev)
 	struct mchp_corespi *spi = spi_master_get_devdata(master);
 
 	mchp_corespi_disable_ints(spi);
-	spi_unregister_master(master);
-	spi_master_put(master);
 	clk_disable_unprepare(spi->clk);
 	mchp_corespi_disable(spi);
 
-- 
2.25.1


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

end of thread, other threads:[~2022-07-13  2:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 13:53 [PATCH -next 1/2] spi: microchip-core: fix UAF in mchp_corespi_remove() Yang Yingliang
2022-07-12 13:53 ` [PATCH -next 2/2] spi: microchip-core: switch to use devm_spi_alloc_master() Yang Yingliang
2022-07-12 14:03   ` Conor.Dooley
2022-07-12 20:50     ` Conor.Dooley
2022-07-13  2:14       ` Yang Yingliang
2022-07-12 20:52 ` [PATCH -next 1/2] spi: microchip-core: fix UAF in mchp_corespi_remove() Conor.Dooley

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