All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure
@ 2020-03-17  4:22 Rayagonda Kokatanur
  2020-03-17 19:31 ` Tyler Hicks
  0 siblings, 1 reply; 3+ messages in thread
From: Rayagonda Kokatanur @ 2020-03-17  4:22 UTC (permalink / raw)
  To: Jassi Brar, linux-kernel, BCM Kernel Feedback; +Cc: Rayagonda Kokatanur

Handle 'cmpl_pool' dma memory allocation failure.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure
  2020-03-17  4:22 [PATCH v1 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure Rayagonda Kokatanur
@ 2020-03-17 19:31 ` Tyler Hicks
  2020-03-18  3:31   ` Rayagonda Kokatanur
  0 siblings, 1 reply; 3+ messages in thread
From: Tyler Hicks @ 2020-03-17 19:31 UTC (permalink / raw)
  To: Rayagonda Kokatanur; +Cc: Jassi Brar, linux-kernel, BCM Kernel Feedback

On 2020-03-17 09:52:16, Rayagonda Kokatanur wrote:
> Handle 'cmpl_pool' dma memory allocation failure.
> 
> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>

This looks correct to me.

Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>

It would be ideal if we could include this tag when applying the fix (or
sending a v2):

Fixes: a9a9da47f8e6 ("mailbox: no need to check return value of debugfs_create functions")

Thanks!

Tyler

> ---
>  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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure
  2020-03-17 19:31 ` Tyler Hicks
@ 2020-03-18  3:31   ` Rayagonda Kokatanur
  0 siblings, 0 replies; 3+ messages in thread
From: Rayagonda Kokatanur @ 2020-03-18  3:31 UTC (permalink / raw)
  To: Tyler Hicks; +Cc: Jassi Brar, Linux Kernel Mailing List, BCM Kernel Feedback

On Wed, Mar 18, 2020 at 1:01 AM Tyler Hicks <tyhicks@linux.microsoft.com> wrote:
>
> On 2020-03-17 09:52:16, Rayagonda Kokatanur wrote:
> > Handle 'cmpl_pool' dma memory allocation failure.
> >
> > Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
>
> This looks correct to me.
>
> Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
>
> It would be ideal if we could include this tag when applying the fix (or
> sending a v2):
>
> Fixes: a9a9da47f8e6 ("mailbox: no need to check return value of debugfs_create functions")
Thank you, added missing Fixes tag and sent v2.

>
> Thanks!
>
> Tyler
>
> > ---
> >  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
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-18  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17  4:22 [PATCH v1 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure Rayagonda Kokatanur
2020-03-17 19:31 ` Tyler Hicks
2020-03-18  3:31   ` Rayagonda Kokatanur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.