linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma: edma.c: remove edma_desc leakage
@ 2013-10-07 22:19 Geyslan G. Bem
  2013-10-11  2:02 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Geyslan G. Bem @ 2013-10-07 22:19 UTC (permalink / raw)
  To: dan.j.williams, vinod.koul; +Cc: linux-kernel, kernel-br, Geyslan G. Bem

Free memory allocated to edma_desc when failing to allocate slot.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/dma/edma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index ff50ff4..3aab605 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
 						EDMA_SLOT_ANY);
 			if (echan->slot[i] < 0) {
 				dev_err(dev, "Failed to allocate slot\n");
+				kfree(edesc);
 				return NULL;
 			}
 		}
-- 
1.8.4


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

* Re: [PATCH] dma: edma.c: remove edma_desc leakage
  2013-10-07 22:19 [PATCH] dma: edma.c: remove edma_desc leakage Geyslan G. Bem
@ 2013-10-11  2:02 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2013-10-11  2:02 UTC (permalink / raw)
  To: Geyslan G. Bem; +Cc: dan.j.williams, linux-kernel, kernel-br

On Mon, Oct 07, 2013 at 07:19:58PM -0300, Geyslan G. Bem wrote:
> Free memory allocated to edma_desc when failing to allocate slot.
> 
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Applied thanks

~Vinod
> ---
>  drivers/dma/edma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index ff50ff4..3aab605 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
>  						EDMA_SLOT_ANY);
>  			if (echan->slot[i] < 0) {
>  				dev_err(dev, "Failed to allocate slot\n");
> +				kfree(edesc);
>  				return NULL;
>  			}
>  		}
> -- 
> 1.8.4
> 

-- 

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

end of thread, other threads:[~2013-10-11  2:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07 22:19 [PATCH] dma: edma.c: remove edma_desc leakage Geyslan G. Bem
2013-10-11  2:02 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).