diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-08-01 23:36:53 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-08-01 23:36:53 +0000 |
commit | 2161eadc3fd63fed7b4b7821c96bdac73de6672d (patch) | |
tree | 6c9d2fb34e91a4d076f957d209221e21dd33d0c8 | |
parent | bda1e149bb2d07f551f4fb18a8e57f7a4fde52c9 (diff) |
Avoid a few NULL dereferences, and boot -c works on vax with glass console.
-rw-r--r-- | sys/arch/vax/vsa/dz_ibus.c | 9 | ||||
-rw-r--r-- | sys/dev/wscons/wskbd.c | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/arch/vax/vsa/dz_ibus.c b/sys/arch/vax/vsa/dz_ibus.c index f60c3c7a8e9..7cb23e205af 100644 --- a/sys/arch/vax/vsa/dz_ibus.c +++ b/sys/arch/vax/vsa/dz_ibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dz_ibus.c,v 1.20 2006/07/30 18:30:51 miod Exp $ */ +/* $OpenBSD: dz_ibus.c,v 1.21 2006/08/01 23:36:51 miod Exp $ */ /* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */ /* * Copyright (c) 1998 Ludd, University of Lule}, Sweden. @@ -381,10 +381,15 @@ dzcnpollc(dev, pollflag) int dzgetc(struct dz_linestate *ls) { - int line = ls->dz_line; + int line; int s; u_short rbuf; + if (ls != NULL) + line = ls->dz_line; + else + line = 0; /* keyboard */ + s = spltty(); for (;;) { for(; (dz->csr & DZ_CSR_RX_DONE) == 0;) diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index 9aa645c9ae1..504f092b67e 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbd.c,v 1.48 2006/07/31 21:54:46 miod Exp $ */ +/* $OpenBSD: wskbd.c,v 1.49 2006/08/01 23:36:52 miod Exp $ */ /* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */ /* @@ -1489,7 +1489,7 @@ wskbd_translate(struct wskbd_internal *id, u_int type, int value) if (type == WSCONS_EVENT_ALL_KEYS_UP) { #if NWSDISPLAY > 0 - if (sc->sc_repeating) { + if (sc != NULL && sc->sc_repeating) { sc->sc_repeating = 0; timeout_del(&sc->sc_repeat_ch); } |