tty/n_gsm.c: fix a memory leak in gsmld_open
authorxinhui.pan <xinhuix.pan@intel.com>
Mon, 28 Jul 2014 08:14:52 +0000 (16:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2014 23:04:54 +0000 (16:04 -0700)
commit5a64096700dc9761b57e767c9f0b740eb2cb84dd
tree4f61f7ef658e9775791730516f5ac81de7d47a59
parent8368d6a2b73900507ad7632b8057532d0c2ee07f
tty/n_gsm.c: fix a memory leak in gsmld_open

If gsmld_attach_gsm fails, the gsm is not used anymore.
tty core will not call gsmld_close to do the cleanup work.
tty core just restore to the tty old ldisc.
That always causes memory leak.

Signed-off-by: xinhui.pan <xinhuiX.pan@intel.com>
Reported-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_gsm.c