Re: [PATCH 5/5] tty: n_gsm: Fixed NULL ptr OOPs in tty_write_room()

From: Alan Cox
Date: Fri Jun 03 2011 - 18:08:37 EST


On Fri, 3 Jun 2011 12:03:41 -0700
Russ Gorby <russ.gorby@xxxxxxxxx> wrote:

> 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.

This is papering over a problem. It shouldn't be happening. Do you have a
copy of the backtrace of the event and does it occur a lot. If it's a one
off freak event so far then instead add

if (gsm->tty == NULL) {
WARN_ON(1);
return -ENXIO;
}

so we get dumps from it and the box survives when it occurs. That'll get
us traces to nail it properly. For one your patch is not a valid
ultimate fix because if it can occur what stops gsm->tty changing as it
occurs.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/