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 098a8da..3519111 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;
                        }
                }