diff mbox series

spi: mxic: Fix an error handling path in mxic_spi_probe()

Message ID 09c81f751241f6ec0bac7a48d4ec814a742e0d17.1648980664.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Accepted
Commit 35d516bdcd92fde46202d06b68df1166760208fd
Headers show
Series spi: mxic: Fix an error handling path in mxic_spi_probe() | expand

Commit Message

Christophe JAILLET April 3, 2022, 10:11 a.m. UTC
If spi_register_master() fails, we must undo a previous
mxic_spi_mem_ecc_probe() call, as already done in the remove function.

Fixes: 00360ebae483 ("spi: mxic: Add support for pipelined ECC operations")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/spi/spi-mxic.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Miquel Raynal April 4, 2022, 7:41 a.m. UTC | #1
Hi Christophe,

christophe.jaillet@wanadoo.fr wrote on Sun,  3 Apr 2022 12:11:13 +0200:

> If spi_register_master() fails, we must undo a previous
> mxic_spi_mem_ecc_probe() call, as already done in the remove function.
> 
> Fixes: 00360ebae483 ("spi: mxic: Add support for pipelined ECC operations")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/spi/spi-mxic.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
> index 55c092069301..65be8e085ab8 100644
> --- a/drivers/spi/spi-mxic.c
> +++ b/drivers/spi/spi-mxic.c
> @@ -813,6 +813,7 @@ static int mxic_spi_probe(struct platform_device *pdev)
>  	if (ret) {
>  		dev_err(&pdev->dev, "spi_register_master failed\n");
>  		pm_runtime_disable(&pdev->dev);
> +		mxic_spi_mem_ecc_remove(mxic);

I missed it, thanks!

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Cheers,
Miquèl
Mark Brown April 5, 2022, 9:32 a.m. UTC | #2
On Sun, 3 Apr 2022 12:11:13 +0200, Christophe JAILLET wrote:
> If spi_register_master() fails, we must undo a previous
> mxic_spi_mem_ecc_probe() call, as already done in the remove function.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: mxic: Fix an error handling path in mxic_spi_probe()
      commit: 35d516bdcd92fde46202d06b68df1166760208fd

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
index 55c092069301..65be8e085ab8 100644
--- a/drivers/spi/spi-mxic.c
+++ b/drivers/spi/spi-mxic.c
@@ -813,6 +813,7 @@  static int mxic_spi_probe(struct platform_device *pdev)
 	if (ret) {
 		dev_err(&pdev->dev, "spi_register_master failed\n");
 		pm_runtime_disable(&pdev->dev);
+		mxic_spi_mem_ecc_remove(mxic);
 	}
 
 	return ret;