diff options
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/n_gsm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index d5f578fe3fa6..152443ab1447 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c | |||
@@ -2366,6 +2366,7 @@ static void gsmld_close(struct tty_struct *tty) | |||
2366 | static int gsmld_open(struct tty_struct *tty) | 2366 | static int gsmld_open(struct tty_struct *tty) |
2367 | { | 2367 | { |
2368 | struct gsm_mux *gsm; | 2368 | struct gsm_mux *gsm; |
2369 | int ret; | ||
2369 | 2370 | ||
2370 | if (tty->ops->write == NULL) | 2371 | if (tty->ops->write == NULL) |
2371 | return -EINVAL; | 2372 | return -EINVAL; |
@@ -2380,7 +2381,13 @@ static int gsmld_open(struct tty_struct *tty) | |||
2380 | 2381 | ||
2381 | /* Attach the initial passive connection */ | 2382 | /* Attach the initial passive connection */ |
2382 | gsm->encoding = 1; | 2383 | gsm->encoding = 1; |
2383 | return gsmld_attach_gsm(tty, gsm); | 2384 | |
2385 | ret = gsmld_attach_gsm(tty, gsm); | ||
2386 | if (ret != 0) { | ||
2387 | gsm_cleanup_mux(gsm); | ||
2388 | mux_put(gsm); | ||
2389 | } | ||
2390 | return ret; | ||
2384 | } | 2391 | } |
2385 | 2392 | ||
2386 | /** | 2393 | /** |