Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/isa If we get into pcclose() without a defined...



details:   https://anonhg.NetBSD.org/src/rev/6735d0f28be0
branches:  trunk
changeset: 474930:6735d0f28be0
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Mon Jul 26 19:31:54 1999 +0000

description:
If we get into pcclose() without a defined tty, just exit rather than
dereferencing a null pointer.

diffstat:

 sys/arch/i386/isa/pccons.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r f95edd87d833 -r 6735d0f28be0 sys/arch/i386/isa/pccons.c
--- a/sys/arch/i386/isa/pccons.c        Mon Jul 26 19:31:53 1999 +0000
+++ b/sys/arch/i386/isa/pccons.c        Mon Jul 26 19:31:54 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccons.c,v 1.135 1999/03/19 04:58:47 cgd Exp $ */
+/*     $NetBSD: pccons.c,v 1.136 1999/07/26 19:31:54 wrstuden Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -849,6 +849,8 @@
        struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)];
        struct tty *tp = sc->sc_tty;
 
+       if (tp == NULL)
+               return (0);
        (*linesw[tp->t_line].l_close)(tp, flag);
        ttyclose(tp);
 #ifdef notyet /* XXX */



Home | Main Index | Thread Index | Old Index