Skip to content

Commit

Permalink
spi: mxic: Fix an error handling path in mxic_spi_probe()
Browse files Browse the repository at this point in the history
If spi_register_master() fails, we must undo a previous
mxic_spi_mem_ecc_probe() call, as already done in the remove function.

Fixes: 00360eb ("spi: mxic: Add support for pipelined ECC operations")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/09c81f751241f6ec0bac7a48d4ec814a742e0d17.1648980664.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Mark Brown committed Apr 4, 2022
1 parent 2f8cf5f commit 35d516b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/spi/spi-mxic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 35d516b

Please sign in to comment.