提交 8120bd46 编写于 作者: R Robert-Ionut Alexa 提交者: Li Yang

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: c93349d8 ("soc: fsl: add DPAA2 console support")
Signed-off-by: NRobert-Ionut Alexa <robert-ionut.alexa@nxp.com>
Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: NLi Yang <leoyang.li@nxp.com>
上级 dc7e5940
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册