soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read
authorRobert-Ionut Alexa <robert-ionut.alexa@nxp.com>
Fri, 23 Apr 2021 09:01:51 +0000 (12:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:24 +0000 (14:04 +0100)
commit41968262bb24772280a0b6fbc808cf740ae961d4
tree201c31edda1cb01dfc675bb58108defc6f7f6e05
parent6caab6c96b67b0751b3ad7f4d14d6e298a3b3790
soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read

[ Upstream commit 8120bd469f5525da229953c1197f2b826c0109f4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/fsl/dpaa2-console.c