summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-06-07 20:32:17 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-06-07 20:32:17 +0000
commitef919092db4bf8af3a3325c40ee885b767369c20 (patch)
treebac8c7a77e6dbb1a3e01f3b89cb22fe038f4c360 /sys/dev
parent07fe2f3a78f1b40763e4410915c9084c9ca104d2 (diff)
Do not stupidly dereference NULL in wsmux_set_display() is invoked with NULL
as the second parameter.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/wscons/wsmux.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c
index d112081b4cb..dbebc647b92 100644
--- a/sys/dev/wscons/wsmux.c
+++ b/sys/dev/wscons/wsmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmux.c,v 1.21 2007/09/17 01:33:33 krw Exp $ */
+/* $OpenBSD: wsmux.c,v 1.22 2008/06/07 20:32:16 miod Exp $ */
/* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */
/*
@@ -762,7 +762,7 @@ wsmux_evsrc_set_display(struct device *dv, struct device *displaydv)
{
struct wsmux_softc *sc = (struct wsmux_softc *)dv;
- DPRINTF(("wsmux_set_display: %s: displaydv=%p\n",
+ DPRINTF(("wsmux_evsrc_set_display: %s: displaydv=%p\n",
sc->sc_base.me_dv.dv_xname, displaydv));
if (displaydv != NULL) {
@@ -801,7 +801,8 @@ wsmux_set_display(struct wsmux_softc *sc, struct device *displaydv)
}
#endif
if (me->me_ops->dsetdisplay != NULL) {
- error = wsevsrc_set_display(me, nsc->sc_displaydv);
+ error = wsevsrc_set_display(me,
+ nsc ? nsc->sc_displaydv : NULL);
DPRINTF(("wsmux_set_display: m=%p dev=%s error=%d\n",
me, me->me_dv.dv_xname, error));
if (!error) {