Commit 229395c9 authored by Linas Vepstas's avatar Linas Vepstas Committed by Linus Torvalds

[PATCH] pSeries hvsi char driver null pointer deref

Under certain rare circumstances, it appears that there can be be a
NULL-pointer deref when a user fiddles with terminal emeulation programs while
outpu is being sent to the console.  This patch checks for and avoids a
NULL-pointer deref.
Signed-off-by: default avatarHollis Blanchard <hollisbl@austin.ibm.com>
Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 825e037f
......@@ -311,7 +311,8 @@ static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,
/* CD went away; no more connection */
pr_debug("hvsi%i: CD dropped\n", hp->index);
hp->mctrl &= TIOCM_CD;
if (!(hp->tty->flags & CLOCAL))
/* If userland hasn't done an open(2) yet, hp->tty is NULL. */
if (hp->tty && !(hp->tty->flags & CLOCAL))
*to_hangup = hp->tty;
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment