diff options
author | Robert-Ionut Alexa <robert-ionut.alexa@nxp.com> | 2021-04-23 11:01:51 +0200 |
---|---|---|
committer | Li Yang <leoyang.li@nxp.com> | 2021-10-22 01:19:52 +0200 |
commit | 8120bd469f5525da229953c1197f2b826c0109f4 (patch) | |
tree | 1c2c488610f5318cc182fab3eb00aa2d195af3c2 /drivers/soc | |
parent | soc: fsl: dpio: use the combined functions to protect critical zone (diff) | |
download | linux-8120bd469f5525da229953c1197f2b826c0109f4.tar.xz linux-8120bd469f5525da229953c1197f2b826c0109f4.zip |
soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read
Free the kbuf buffer before returning from the dpaa2_console_read()
function. The variable no longer goes out of scope, leaking the storage
it points to.
Fixes: c93349d8c170 ("soc: fsl: add DPAA2 console support")
Signed-off-by: Robert-Ionut Alexa <robert-ionut.alexa@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/fsl/dpaa2-console.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-console.c index 27243f706f37..53917410f2bd 100644 --- a/drivers/soc/fsl/dpaa2-console.c +++ b/drivers/soc/fsl/dpaa2-console.c @@ -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: |