Skip to content

Commit fc739a0

Browse files
Navidemgregkh
authored andcommitted
misc: fastrpc: prevent memory leak in fastrpc_dma_buf_attach
In fastrpc_dma_buf_attach if dma_get_sgtable fails the allocated memory for a should be released. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Link: https://lore.kernel.org/r/20190925152742.16258-1-navid.emamdoost@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f8204f0 commit fc739a0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: drivers/misc/fastrpc.c

+1
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ static int fastrpc_dma_buf_attach(struct dma_buf *dmabuf,
527527
FASTRPC_PHYS(buffer->phys), buffer->size);
528528
if (ret < 0) {
529529
dev_err(buffer->dev, "failed to get scatterlist from DMA API\n");
530+
kfree(a);
530531
return -EINVAL;
531532
}
532533

0 commit comments

Comments
 (0)