Skip to content

Commit 1084715

Browse files
ticat123ambarus
authored andcommitted
spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed
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> Link: https://lore.kernel.org/r/1594111842-9468-1-git-send-email-fanpeng@loongson.cn Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 2d9a744) Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
1 parent 7969212 commit 1084715

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/spi/spi-atmel.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,10 +1525,9 @@ static int atmel_spi_probe(struct platform_device *pdev)
15251525
return PTR_ERR(clk);
15261526

15271527
/* setup spi core then atmel-specific driver state */
1528-
ret = -ENOMEM;
15291528
master = spi_alloc_master(&pdev->dev, sizeof(*as));
15301529
if (!master)
1531-
goto out_free;
1530+
return -ENOMEM;
15321531

15331532
/* the spi->mode bits understood by this driver: */
15341533
master->use_gpio_descriptors = true;

0 commit comments

Comments
 (0)