Messages in this thread Patch in this message | | | From | Russ Gorby <> | Subject | [PATCH 5/5] tty: n_gsm: Fixed NULL ptr OOPs in tty_write_room() | Date | Fri, 3 Jun 2011 12:03:41 -0700 |
| |
We saw a case where gsmld_output was called after the MUX was shutdown. In this case gsm->tty was null so tty_write_room(NULL) was called which resulted in an exception.
checked for gsm->tty == NULL in gsmld_output()
Signed-off-by: Russ Gorby <russ.gorby@intel.com> --- drivers/tty/n_gsm.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 22c844d..2908199 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2168,6 +2168,8 @@ EXPORT_SYMBOL_GPL(gsm_alloc_mux); static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len) { + if (!gsm->tty) + return -ENXIO; if (tty_write_room(gsm->tty) < len) { set_bit(TTY_DO_WRITE_WAKEUP, &gsm->tty->flags); return -ENOSPC; -- 1.7.0.4
| |