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>
1 file changed