Thread (2 messages) 2 messages, 2 authors, 2021-06-09
STALE1829d

[PATCH v2] spi: spi-at91-usart: Fix wrong goto jump label when spi_alloc_master() returns error.

From: zpershuai <hidden>
Date: 2021-06-09 02:49:47
Also in: linux-spi, lkml
Subsystem: microchip at91 usart spi driver, spi subsystem, the rest · Maintainers: Radu Pirea, Mark Brown, Linus Torvalds

When spi_alloc_master() returns null pointer, it’s no need to use
spi_master_put() to release the memory, although spi_master_put()
function has null pointer checks.

Signed-off-by: zpershuai <redacted>
---
 drivers/spi/spi-at91-usart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index 8c83526..e5c2d2c 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -531,10 +531,9 @@ static int at91_usart_spi_probe(struct platform_device *pdev)
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 
-	ret = -ENOMEM;
 	controller = spi_alloc_master(&pdev->dev, sizeof(*aus));
 	if (!controller)
-		goto at91_usart_spi_probe_fail;
+		return -ENOMEM;
 
 	ret = at91_usart_gpio_setup(pdev);
 	if (ret)
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help