Thread (40 messages) 40 messages, 2 authors, 2022-10-20
STALE1343d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 30/33] dmaengine: at_hdmac: Check return code of dma_async_device_register

From: Tudor Ambarus <hidden>
Date: 2022-08-20 13:01:12
Also in: dmaengine, lkml
Subsystem: dma generic offload engine subsystem, microchip at91 dma drivers, the rest · Maintainers: Vinod Koul, Ludovic Desroches, Linus Torvalds

dma_async_device_register() can fail, check the return code and display an
error.

Signed-off-by: Tudor Ambarus <redacted>
---
 drivers/dma/at_hdmac.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 042c7cba74bb..0b473e6d161d 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -2353,7 +2353,11 @@ static int __init at_dma_probe(struct platform_device *pdev)
 	  dma_has_cap(DMA_SLAVE, atdma->dma_device.cap_mask)  ? "slave " : "",
 	  plat_dat->nr_channels);
 
-	dma_async_device_register(&atdma->dma_device);
+	err = dma_async_device_register(&atdma->dma_device);
+	if (err) {
+		dev_err(&pdev->dev, "Unable to register: %d.\n", err);
+		goto err_dma_async_device_register;
+	}
 
 	/*
 	 * Do not return an error if the dmac node is not present in order to
@@ -2373,6 +2377,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 
 err_of_dma_controller_register:
 	dma_async_device_unregister(&atdma->dma_device);
+err_dma_async_device_register:
 	dma_pool_destroy(atdma->memset_pool);
 err_memset_pool_create:
 	dma_pool_destroy(atdma->dma_desc_pool);
-- 
2.25.1


_______________________________________________
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