diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-01-07 13:28:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-01-07 13:28:51 +0000 |
commit | a59f96bb423e2e71d49d49e9c18c7b4286789731 (patch) | |
tree | d16915c72a74f6a079e35fbce7d311897f45c4fe /sys/dev/wscons/wsemul_sun.c | |
parent | 0a883e2832fbbb400ea83340c6603ecea40a0ae5 (diff) |
Change allocations to M_NOWAIT in attach methods, and return NULL if they fail.
Diffstat (limited to 'sys/dev/wscons/wsemul_sun.c')
-rw-r--r-- | sys/dev/wscons/wsemul_sun.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/wscons/wsemul_sun.c b/sys/dev/wscons/wsemul_sun.c index 633b67456c6..a12f8b0a009 100644 --- a/sys/dev/wscons/wsemul_sun.c +++ b/sys/dev/wscons/wsemul_sun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_sun.c,v 1.18 2006/12/02 11:25:09 miod Exp $ */ +/* $OpenBSD: wsemul_sun.c,v 1.19 2007/01/07 13:28:50 miod Exp $ */ /* $NetBSD: wsemul_sun.c,v 1.11 2000/01/05 11:19:36 drochner Exp $ */ /* @@ -216,7 +216,9 @@ wsemul_sun_attach(console, type, cookie, ccol, crow, cbcookie, defattr) KASSERT(edp->console == 1); #endif } else { - edp = malloc(sizeof *edp, M_DEVBUF, M_WAITOK); + edp = malloc(sizeof *edp, M_DEVBUF, M_NOWAIT); + if (edp == NULL) + return (NULL); wsemul_sun_init(edp, type, cookie, ccol, crow, defattr); #ifdef DIAGNOSTIC |