From: <Conor.Dooley@microchip.com>
To: <yangyingliang@huawei.com>, <broonie@kernel.org>
Cc: <Conor.Dooley@microchip.com>, <Daire.McNamara@microchip.com>,
<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
<linux-spi@vger.kernel.org>
Subject: Re: [PATCH -next 1/2] spi: microchip-core: fix UAF in mchp_corespi_remove()
Date: Tue, 12 Jul 2022 20:52:25 +0000 [thread overview]
Message-ID: <0f43a8a1-3df3-9704-c7f8-414496df40e4@microchip.com> (raw)
In-Reply-To: <20220712135357.918997-1-yangyingliang@huawei.com>
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@huawei.com>
With 59ebbe40fb51 ("spi: simplify devm_spi register_controller") reverted,
this looks good to me.
Reviewed-by: Conor Dooley <conor.dooley@microchip.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);
>
prev parent reply other threads:[~2022-07-12 20:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 14:03 ` Conor.Dooley
2022-07-12 20:50 ` Conor.Dooley
2022-07-13 2:14 ` Yang Yingliang
2022-07-12 20:52 ` Conor.Dooley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0f43a8a1-3df3-9704-c7f8-414496df40e4@microchip.com \
--to=conor.dooley@microchip.com \
--cc=Daire.McNamara@microchip.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®