mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read
[ Upstream commit8120bd469f
] 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:c93349d8c1
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
be832f781d
commit
15351d5e8b
1 changed files with 1 additions and 0 deletions
|
@ -231,6 +231,7 @@ static ssize_t dpaa2_console_read(struct file *fp, char __user *buf,
|
||||||
cd->cur_ptr += bytes;
|
cd->cur_ptr += bytes;
|
||||||
written += bytes;
|
written += bytes;
|
||||||
|
|
||||||
|
kfree(kbuf);
|
||||||
return written;
|
return written;
|
||||||
|
|
||||||
err_free_buf:
|
err_free_buf:
|
||||||
|
|
Loading…
Reference in a new issue