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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f8204f0 commit fc739a0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/misc/fastrpc.c

Lines changed: 1 addition & 0 deletions
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)