[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0f43a8a1-3df3-9704-c7f8-414496df40e4@microchip.com>
Date: Tue, 12 Jul 2022 20:52:25 +0000
From: <Conor.Dooley@...rochip.com>
To: <yangyingliang@...wei.com>, <broonie@...nel.org>
CC: <Conor.Dooley@...rochip.com>, <Daire.McNamara@...rochip.com>,
<linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<linux-spi@...r.kernel.org>
Subject: Re: [PATCH -next 1/2] spi: microchip-core: fix UAF in
mchp_corespi_remove()
On 12/07/2022 14:53, Yang Yingliang wrote:
> 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@...wei.com>
With 59ebbe40fb51 ("spi: simplify devm_spi register_controller") reverted,
this looks good to me.
Reviewed-by: Conor Dooley <conor.dooley@...rochip.com>
Thanks!
> ---
> 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);
>
Powered by blists - more mailing lists