diff mbox series

spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed

Message ID 1594111842-9468-1-git-send-email-fanpeng@loongson.cn (mailing list archive)
State Accepted
Commit 2d9a744685bc3a4bf1d097782550c450ff0c3b04
Headers show
Series spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed | expand

Commit Message

Peng Fan July 7, 2020, 8:50 a.m. UTC
There is no need to call spi_master_put() if spi_alloc_master()
failed, it should return -ENOMEM directly.

Signed-off-by: Peng Fan <fanpeng@loongson.cn>
---
 drivers/spi/spi-atmel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Mark Brown July 8, 2020, 5 p.m. UTC | #1
On Tue, 7 Jul 2020 16:50:42 +0800, Peng Fan wrote:
> There is no need to call spi_master_put() if spi_alloc_master()
> failed, it should return -ENOMEM directly.

Applied to

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

Thanks!

[1/1] spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed
      commit: 2d9a744685bc3a4bf1d097782550c450ff0c3b04

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-atmel.c b/drivers/spi/spi-atmel.c
index 57ee8c3..6ed7abd 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1546,10 +1546,9 @@  static int atmel_spi_probe(struct platform_device *pdev)
 		return PTR_ERR(clk);
 
 	/* setup spi core then atmel-specific driver state */
-	ret = -ENOMEM;
 	master = spi_alloc_master(&pdev->dev, sizeof(*as));
 	if (!master)
-		goto out_free;
+		return -ENOMEM;
 
 	/* the spi->mode bits understood by this driver: */
 	master->use_gpio_descriptors = true;