diff options
| author | toshii <toshii@NetBSD.org> | 2001-08-02 14:40:04 +0000 |
|---|---|---|
| committer | toshii <toshii@NetBSD.org> | 2001-08-02 14:40:04 +0000 |
| commit | f2c68887e0fe5ae151ba574dda7d1b9bb79bbe55 (patch) | |
| tree | a1e4f748282e0dd360374ae850758c87515a3b62 /sys/dev/hpc | |
| parent | 47133068ba9d3b1fbea909fb2405dfd1ea9ee5b0 (diff) | |
Check if sc->sc_dc is NULL, so that non-console hpcfb can attach without
a panic.
Diffstat (limited to 'sys/dev/hpc')
| -rw-r--r-- | sys/dev/hpc/hpcfb.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/hpc/hpcfb.c b/sys/dev/hpc/hpcfb.c index 7a9e5ea20e6..8ef81978c3b 100644 --- a/sys/dev/hpc/hpcfb.c +++ b/sys/dev/hpc/hpcfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpcfb.c,v 1.12 2001/07/31 10:50:06 sato Exp $ */ +/* $NetBSD: hpcfb.c,v 1.13 2001/08/02 14:40:04 toshii Exp $ */ /*- * Copyright (c) 1999 @@ -46,7 +46,7 @@ static const char _copyright[] __attribute__ ((unused)) = "Copyright (c) 1999 Shin Takemura. All rights reserved."; static const char _rcsid[] __attribute__ ((unused)) = - "$NetBSD: hpcfb.c,v 1.12 2001/07/31 10:50:06 sato Exp $"; + "$NetBSD: hpcfb.c,v 1.13 2001/08/02 14:40:04 toshii Exp $"; #include <sys/param.h> #include <sys/systm.h> @@ -781,10 +781,13 @@ hpcfb_show_screen(void *v, void *cookie, int waitok, hpcfb_refresh_screen(sc); return (0); } - odc->dc_state |= HPCFB_DC_SWITCHREQ; - if ((odc->dc_state&HPCFB_DC_DRAWING) != 0) { - odc->dc_state |= HPCFB_DC_ABORT; + if (odc != NULL) { + odc->dc_state |= HPCFB_DC_SWITCHREQ; + + if ((odc->dc_state&HPCFB_DC_DRAWING) != 0) { + odc->dc_state |= HPCFB_DC_ABORT; + } } sc->sc_wantedscreen = cookie; @@ -848,7 +851,8 @@ hpcfb_doswitch(struct hpcfb_softc *sc) if (sc->sc_switchcb) (*sc->sc_switchcb)(sc->sc_switchcbarg, 0, 0); - odc->dc_state &= ~HPCFB_DC_SWITCHREQ; + if (odc != NULL) + odc->dc_state &= ~HPCFB_DC_SWITCHREQ; dc->dc_state &= ~HPCFB_DC_SWITCHREQ; return; } |
