Skip to content

Commit 8120bd4

Browse files
Robert-Ionut AlexaLi Yang
authored andcommitted
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: c93349d ("soc: fsl: add DPAA2 console support") Signed-off-by: Robert-Ionut Alexa <[email protected]> Signed-off-by: Ioana Ciornei <[email protected]> Signed-off-by: Li Yang <[email protected]>
1 parent dc7e594 commit 8120bd4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/soc/fsl/dpaa2-console.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ static ssize_t dpaa2_console_read(struct file *fp, char __user *buf,
231231
cd->cur_ptr += bytes;
232232
written += bytes;
233233

234+
kfree(kbuf);
234235
return written;
235236

236237
err_free_buf:

0 commit comments

Comments
 (0)