提交 4b6271a6 编写于 作者: V Valentin Ilie 提交者: Vinod Koul

dma: edma: Fix memory leak

When it fails to allocate a slot, edesc should be free'd before return;
Signed-off-by: NValentin Ilie <valentin.ilie@gmail.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 18ebd564
......@@ -305,6 +305,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
edma_alloc_slot(EDMA_CTLR(echan->ch_num),
EDMA_SLOT_ANY);
if (echan->slot[i] < 0) {
kfree(edesc);
dev_err(dev, "Failed to allocate slot\n");
kfree(edesc);
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册