diff options
author | 2001-05-16 19:33:33 +0000 | |
---|---|---|
committer | 2001-05-16 19:33:33 +0000 | |
commit | fbb9dd3a979eea767c5342b0147ff198ce33e3f5 (patch) | |
tree | 42325c6f24faca14c94ededfcb040642ab951f78 | |
parent | it is notright to malloc() w/ WAITOK at attach time, put back NULL check and change to NOWAIT (diff) | |
download | wireguard-openbsd-fbb9dd3a979eea767c5342b0147ff198ce33e3f5.tar.xz wireguard-openbsd-fbb9dd3a979eea767c5342b0147ff198ce33e3f5.zip |
malloc memory w/ NOWAIT during autoconf time, and check for NULL
-rw-r--r-- | sys/dev/pci/tga.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/tga.c b/sys/dev/pci/tga.c index b1c1847d31e..1cfdf4e77d6 100644 --- a/sys/dev/pci/tga.c +++ b/sys/dev/pci/tga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga.c,v 1.6 2001/03/19 00:18:05 aaron Exp $ */ +/* $OpenBSD: tga.c,v 1.7 2001/05/16 19:33:33 mickey Exp $ */ /* $NetBSD: tga.c,v 1.31 2001/02/11 19:34:58 nathanw Exp $ */ /* @@ -426,7 +426,9 @@ tgaattach(parent, self, aux) sc->nscreens = 1; } else { sc->sc_dc = (struct tga_devconfig *) - malloc(sizeof(struct tga_devconfig), M_DEVBUF, M_WAITOK); + malloc(sizeof(struct tga_devconfig), M_DEVBUF, M_NOWAIT); + if (sc->sc_dc == NULL) + return; bzero(sc->sc_dc, sizeof(struct tga_devconfig)); tga_getdevconfig(pa->pa_memt, pa->pa_pc, pa->pa_tag, sc->sc_dc); |