[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1307144642-5915-6-git-send-email-russ.gorby@intel.com>
Date: Fri, 3 Jun 2011 16:44:00 -0700
From: Russ Gorby <russ.gorby@...el.com>
To: Greg Kroah-Hartman <gregkh@...e.de>,
Russ Gorby <russ.gorby@...el.com>, linux-kernel@...r.kernel.org
Cc: suhail.ahmed@...el.com, russ.gorby@...el.com
Subject: [PATCHv2 5/7] tty: n_gsm: Fixed NULL ptr OOPs in tty_write_room()
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@...el.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists