提交 c47e6403 编写于 作者: T Tudor Ambarus 提交者: Vinod Koul

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: dc78baa2 ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller")
Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
Cc: stable@vger.kernel.org
Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com
Link: https://lore.kernel.org/r/20221025090306.297886-16-tudor.ambarus@microchip.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
上级 28cbe5a0
...@@ -1928,7 +1928,11 @@ static int __init at_dma_probe(struct platform_device *pdev) ...@@ -1928,7 +1928,11 @@ static int __init at_dma_probe(struct platform_device *pdev)
dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "", dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "",
plat_dat->nr_channels); plat_dat->nr_channels);
dma_async_device_register(&atdma->dma_common); err = dma_async_device_register(&atdma->dma_common);
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 * 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) ...@@ -1948,6 +1952,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
err_of_dma_controller_register: err_of_dma_controller_register:
dma_async_device_unregister(&atdma->dma_common); dma_async_device_unregister(&atdma->dma_common);
err_dma_async_device_register:
dma_pool_destroy(atdma->memset_pool); dma_pool_destroy(atdma->memset_pool);
err_memset_pool_create: err_memset_pool_create:
dma_pool_destroy(atdma->dma_desc_pool); dma_pool_destroy(atdma->dma_desc_pool);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册