summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-05-16 19:38:28 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-05-16 19:38:28 +0000
commit40be84abe1cbe29af2d8f6c22177f3641c39c90a (patch)
tree34f7c8471c14903708656b40ee3a661acddd09c2 /sys
parent8fcf1a0753ee730cae452fe7f3126b2750a03d45 (diff)
it is not right to malloc() w/ WAITOK at attach time, put back NULL check and change to NOWAIT
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wscons/wsdisplay.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index dbfa6441287..6b9a371bb86 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.27 2001/05/16 12:51:50 ho Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.28 2001/05/16 19:38:27 mickey Exp $ */
/* $NetBSD: wsdisplay.c,v 1.37.4.1 2000/06/30 16:27:53 simonb Exp $ */
/*
@@ -265,7 +265,9 @@ wsscreen_attach(sc, console, emul, type, cookie, ccol, crow, defattr)
struct wsscreen_internal *dconf;
struct wsscreen *scr;
- scr = malloc(sizeof(struct wsscreen), M_DEVBUF, M_WAITOK);
+ scr = malloc(sizeof(struct wsscreen), M_DEVBUF, M_NOWAIT);
+ if (!scr)
+ return (scr);
if (console) {
dconf = &wsdisplay_console_conf;
@@ -650,6 +652,8 @@ wsdisplay_common_attach(sc, console, scrdata, accessops, accesscookie)
KASSERT(wsdisplay_console_device == NULL);
sc->sc_scr[0] = wsscreen_attach(sc, 1, 0, 0, 0, 0, 0, 0);
+ if (sc->sc_scr[0] == NULL)
+ return;
wsdisplay_console_device = sc;
printf(": console (%s, %s emulation)",