Re: [PATCH] drivers/tty/tty_io.c: fix a potential memleak at do_tty_write()
From: Alan Cox <hidden> Date: 2012-06-18 16:00:34
On Mon, 18 Jun 2012 20:23:54 +0800
Jeff Liu [off-list ref] wrote:
Hello,
Looks there is a potential memory leak at drivers/tty/tty_io.c: do_tty_write().
It did allocate a buf_chunk if tty->write_cnt < chunk, however, buf_chunk was not
freed after the writing is done. Below tiny patch could fix it.
Why should it be freed, we still have a reference to it.
Alan