maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure

Handle 'cmpl_pool' dma memory allocation failure.

Fixes: a9a9da47f8 ("mailbox: no need to check return value of debugfs_create functions")
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
This commit is contained in:
Rayagonda Kokatanur 2020-03-18 09:00:55 +05:30 коммит произвёл Jassi Brar
Родитель 25831c44b0
Коммит 64d0da512b
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -1599,6 +1599,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
1 << RING_CMPL_ALIGN_ORDER, 0); 1 << RING_CMPL_ALIGN_ORDER, 0);
if (!mbox->cmpl_pool) { if (!mbox->cmpl_pool) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail_destroy_bd_pool;
} }
/* Allocate platform MSIs for each ring */ /* Allocate platform MSIs for each ring */
@ -1661,6 +1662,7 @@ fail_free_debugfs_root:
platform_msi_domain_free_irqs(dev); platform_msi_domain_free_irqs(dev);
fail_destroy_cmpl_pool: fail_destroy_cmpl_pool:
dma_pool_destroy(mbox->cmpl_pool); dma_pool_destroy(mbox->cmpl_pool);
fail_destroy_bd_pool:
dma_pool_destroy(mbox->bd_pool); dma_pool_destroy(mbox->bd_pool);
fail: fail:
return ret; return ret;