2020-03-18 03:31:42

by Rayagonda Kokatanur

[permalink] [raw]
Subject: [PATCH v2 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure

Handle 'cmpl_pool' dma memory allocation failure.

Fixes: a9a9da47f8e6 ("mailbox: no need to check return value of debugfs_create functions")
Signed-off-by: Rayagonda Kokatanur <[email protected]>
---
Changes from v1:
- Address code review comments from Tyler Hicks,
Add missing Fixes tag.

drivers/mailbox/bcm-flexrm-mailbox.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
index 8ee9db274802..bee33abb5308 100644
--- a/drivers/mailbox/bcm-flexrm-mailbox.c
+++ b/drivers/mailbox/bcm-flexrm-mailbox.c
@@ -1599,6 +1599,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
1 << RING_CMPL_ALIGN_ORDER, 0);
if (!mbox->cmpl_pool) {
ret = -ENOMEM;
+ goto fail_destroy_bd_pool;
}

/* Allocate platform MSIs for each ring */
@@ -1661,6 +1662,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
platform_msi_domain_free_irqs(dev);
fail_destroy_cmpl_pool:
dma_pool_destroy(mbox->cmpl_pool);
+fail_destroy_bd_pool:
dma_pool_destroy(mbox->bd_pool);
fail:
return ret;
--
2.17.1


2020-03-18 03:48:16

by Tyler Hicks

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure

On 2020-03-18 09:00:55, Rayagonda Kokatanur wrote:
> Handle 'cmpl_pool' dma memory allocation failure.
>
> Fixes: a9a9da47f8e6 ("mailbox: no need to check return value of debugfs_create functions")
> Signed-off-by: Rayagonda Kokatanur <[email protected]>

Thanks for adding the Fixes tag.

Reviewed-by: Tyler Hicks <[email protected]>

Tyler

> ---
> Changes from v1:
> - Address code review comments from Tyler Hicks,
> Add missing Fixes tag.
>
> drivers/mailbox/bcm-flexrm-mailbox.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
> index 8ee9db274802..bee33abb5308 100644
> --- a/drivers/mailbox/bcm-flexrm-mailbox.c
> +++ b/drivers/mailbox/bcm-flexrm-mailbox.c
> @@ -1599,6 +1599,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
> 1 << RING_CMPL_ALIGN_ORDER, 0);
> if (!mbox->cmpl_pool) {
> ret = -ENOMEM;
> + goto fail_destroy_bd_pool;
> }
>
> /* Allocate platform MSIs for each ring */
> @@ -1661,6 +1662,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
> platform_msi_domain_free_irqs(dev);
> fail_destroy_cmpl_pool:
> dma_pool_destroy(mbox->cmpl_pool);
> +fail_destroy_bd_pool:
> dma_pool_destroy(mbox->bd_pool);
> fail:
> return ret;
> --
> 2.17.1
>