diff options
Diffstat (limited to 'drivers/dma/edma.c')
-rw-r--r-- | drivers/dma/edma.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 3519111c566b..10b577fcf48d 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
@@ -305,6 +305,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( | |||
305 | edma_alloc_slot(EDMA_CTLR(echan->ch_num), | 305 | edma_alloc_slot(EDMA_CTLR(echan->ch_num), |
306 | EDMA_SLOT_ANY); | 306 | EDMA_SLOT_ANY); |
307 | if (echan->slot[i] < 0) { | 307 | if (echan->slot[i] < 0) { |
308 | kfree(edesc); | ||
308 | dev_err(dev, "Failed to allocate slot\n"); | 309 | dev_err(dev, "Failed to allocate slot\n"); |
309 | kfree(edesc); | 310 | kfree(edesc); |
310 | return NULL; | 311 | return NULL; |
@@ -346,6 +347,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( | |||
346 | ccnt = sg_dma_len(sg) / (acnt * bcnt); | 347 | ccnt = sg_dma_len(sg) / (acnt * bcnt); |
347 | if (ccnt > (SZ_64K - 1)) { | 348 | if (ccnt > (SZ_64K - 1)) { |
348 | dev_err(dev, "Exceeded max SG segment size\n"); | 349 | dev_err(dev, "Exceeded max SG segment size\n"); |
350 | kfree(edesc); | ||
349 | return NULL; | 351 | return NULL; |
350 | } | 352 | } |
351 | cidx = acnt * bcnt; | 353 | cidx = acnt * bcnt; |