]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dma: edma.c: remove edma_desc leakage
authorGeyslan G. Bem <geyslan@gmail.com>
Mon, 7 Oct 2013 22:19:58 +0000 (19:19 -0300)
committerVinod Koul <vinod.koul@intel.com>
Fri, 11 Oct 2013 02:01:47 +0000 (07:31 +0530)
Free memory allocated to edma_desc when failing to allocate slot.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/edma.c

index 098a8da450f0cababa616ef83f1e65fa82578ea1..3519111c566b8a3bc9a43b8b89bc2b866c3d833e 100644 (file)
@@ -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;
                        }
                }