未验证 提交 e82c6d62 编写于 作者: Y Yang Yingliang 提交者: Mark Brown

spi: microchip-core: fix UAF in mchp_corespi_remove()

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: 9ac8d176 ("spi: add support for microchip fpga spi controllers")
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NConor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20220713025657.3524506-2-yangyingliang@huawei.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 cdb0cc93
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册