Skip to content

Commit c47e640

Browse files
ambarusvinodkoul
authored andcommitted
dmaengine: at_hdmac: Check return code of dma_async_device_register
dma_async_device_register() can fail, check the return code and display an error. Fixes: dc78baa ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Signed-off-by: Tudor Ambarus <[email protected]> Cc: [email protected] Acked-by: Nicolas Ferre <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 28cbe5a commit c47e640

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/dma/at_hdmac.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,11 @@ static int __init at_dma_probe(struct platform_device *pdev)
19281928
dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "",
19291929
plat_dat->nr_channels);
19301930

1931-
dma_async_device_register(&atdma->dma_common);
1931+
err = dma_async_device_register(&atdma->dma_common);
1932+
if (err) {
1933+
dev_err(&pdev->dev, "Unable to register: %d.\n", err);
1934+
goto err_dma_async_device_register;
1935+
}
19321936

19331937
/*
19341938
* Do not return an error if the dmac node is not present in order to
@@ -1948,6 +1952,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
19481952

19491953
err_of_dma_controller_register:
19501954
dma_async_device_unregister(&atdma->dma_common);
1955+
err_dma_async_device_register:
19511956
dma_pool_destroy(atdma->memset_pool);
19521957
err_memset_pool_create:
19531958
dma_pool_destroy(atdma->dma_desc_pool);

0 commit comments

Comments
 (0)