projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f8204f0
)
misc: fastrpc: prevent memory leak in fastrpc_dma_buf_attach
author
Navid Emamdoost
<navid.emamdoost@gmail.com>
Wed, 25 Sep 2019 15:27:41 +0000
(10:27 -0500)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 4 Oct 2019 16:22:14 +0000
(18:22 +0200)
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>
drivers/misc/fastrpc.c
patch
|
blob
|
history
diff --git
a/drivers/misc/fastrpc.c
b/drivers/misc/fastrpc.c
index 47ae84afac2e1ee39e93d771f60ebdb49bb78092..1b1a794d639d0d8518e1bbb351966aee8ee74b23 100644
(file)
--- a/
drivers/misc/fastrpc.c
+++ b/
drivers/misc/fastrpc.c
@@
-527,6
+527,7
@@
static int fastrpc_dma_buf_attach(struct dma_buf *dmabuf,
FASTRPC_PHYS(buffer->phys), buffer->size);
if (ret < 0) {
dev_err(buffer->dev, "failed to get scatterlist from DMA API\n");
+ kfree(a);
return -EINVAL;
}