projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f502a7
)
dpaa2-console.c: free buffer before returning from dpaa2_console_read
author
Robert-Ionut Alexa
<robert-ionut.alexa@nxp.com>
Fri, 23 Apr 2021 09:01:51 +0000
(12:01 +0300)
committer
Xiaobo Xie
<xiaobo.xie@nxp.com>
Thu, 3 Jun 2021 04:09:09 +0000
(06:09 +0200)
Dpaa2_console_read function frees kbuf buffer before returning.
The variable no longer goes out of scope, leaking the storage it
points to.
Signed-off-by: Robert-Ionut Alexa <robert-ionut.alexa@nxp.com>
drivers/soc/fsl/dpaa2-console.c
patch
|
blob
|
history
diff --git
a/drivers/soc/fsl/dpaa2-console.c
b/drivers/soc/fsl/dpaa2-console.c
index
27243f7
..
e823fb9
100644
(file)
--- a/
drivers/soc/fsl/dpaa2-console.c
+++ b/
drivers/soc/fsl/dpaa2-console.c
@@
-3,7
+3,7
@@
* Freescale DPAA2 Platforms Console Driver
*
* Copyright 2015-2016 Freescale Semiconductor Inc.
- * Copyright 20
18
NXP
+ * Copyright 20
21
NXP
*/
#define pr_fmt(fmt) "dpaa2-console: " fmt
@@
-231,6
+231,7
@@
static ssize_t dpaa2_console_read(struct file *fp, char __user *buf,
cd->cur_ptr += bytes;
written += bytes;
+ kfree(kbuf);
return written;
err_free_buf: