提交 dafa7317 编写于 作者: R Russell King - ARM Linux 提交者: Dan Williams

ARM: PL08x: fix a leak when preparing TXDs

If we fail to allocate the LLI, the prep_* function will return NULL.
However, the TXD we allocated will not be placed on any list, nor
will it be freed - we'll just drop all references to it.  Make sure
we free it rather than leaking TXDs.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
Acked-by: NLinus Walleij <linus.walleij@stericsson.com>
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 bf072af4
......@@ -1332,9 +1332,10 @@ static int pl08x_prep_channel_resources(struct pl08x_dma_chan *plchan,
int ret;
num_llis = pl08x_fill_llis_for_desc(pl08x, txd);
if (!num_llis)
if (!num_llis) {
kfree(txd);
return -EINVAL;
}
spin_lock_irqsave(&plchan->lock, plchan->lockflags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册