Re: [PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Pan Xinhui
hi, Jiri thanks for your kind reply, and the nice advices. :) On 2015年03月23日 23:23, Jiri Slaby wrote: On 03/24/2015, 08:22 AM, Pan Xinhui wrote: In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, tty_port_destructor will be called, and it will check if port->itty is

Re: [PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Jiri Slaby
On 03/24/2015, 08:22 AM, Pan Xinhui wrote: > In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, > tty_port_destructor will be called, and it will check if port->itty is > NULL. > However port->itty will be set to NULL in release_tty after gsmtty_remove. > that may cause memory

[PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Pan Xinhui
In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, tty_port_destructor will be called, and it will check if port->itty is NULL. However port->itty will be set to NULL in release_tty after gsmtty_remove. that may cause memory leak. so we use queue_work to put the dlci later.

[PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Pan Xinhui
In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, tty_port_destructor will be called, and it will check if port->itty is NULL. However port->itty will be set to NULL in release_tty after gsmtty_remove. that may cause memory leak. so we use queue_work to put the dlci later.

Re: [PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Jiri Slaby
On 03/24/2015, 08:22 AM, Pan Xinhui wrote: In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, tty_port_destructor will be called, and it will check if port-itty is NULL. However port-itty will be set to NULL in release_tty after gsmtty_remove. that may cause memory leak. so we

[PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Pan Xinhui
In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, tty_port_destructor will be called, and it will check if port-itty is NULL. However port-itty will be set to NULL in release_tty after gsmtty_remove. that may cause memory leak. so we use queue_work to put the dlci later.

[PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Pan Xinhui
In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, tty_port_destructor will be called, and it will check if port-itty is NULL. However port-itty will be set to NULL in release_tty after gsmtty_remove. that may cause memory leak. so we use queue_work to put the dlci later.

Re: [PATCH] tty/n_gsm.c: fix a memory leak when gsmtty is removed

2015-03-23 Thread Pan Xinhui
hi, Jiri thanks for your kind reply, and the nice advices. :) On 2015年03月23日 23:23, Jiri Slaby wrote: On 03/24/2015, 08:22 AM, Pan Xinhui wrote: In gsmtty_remove, we will put dlci. when dlci's ref-count is zero, tty_port_destructor will be called, and it will check if port-itty is