瀏覽代碼

dmaengine: edma: fix another memory leak

commit 4b6271a6 fix a menory leak but one more existed in driver so fix that

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Vinod Koul 11 年之前
父節點
當前提交
7261828776
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/dma/edma.c

+ 1 - 0
drivers/dma/edma.c

@@ -347,6 +347,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
 			ccnt = sg_dma_len(sg) / (acnt * bcnt);
 			ccnt = sg_dma_len(sg) / (acnt * bcnt);
 			if (ccnt > (SZ_64K - 1)) {
 			if (ccnt > (SZ_64K - 1)) {
 				dev_err(dev, "Exceeded max SG segment size\n");
 				dev_err(dev, "Exceeded max SG segment size\n");
+				kfree(edesc);
 				return NULL;
 				return NULL;
 			}
 			}
 			cidx = acnt * bcnt;
 			cidx = acnt * bcnt;