From 1e49b19cb0720459eb397cd5d471a7777f4c27c8 Mon Sep 17 00:00:00 2001 From: bde Date: Fri, 1 Jan 1999 12:35:47 +0000 Subject: The previous commit was bogus. malloc(..., M_WAITOK) should not be used in device attach routines. At least for attaches at boot time, actually waiting, or actually failing for malloc(..., M_NOWAIT), are almost equally unlikely and harmless, but using M_WAITOK interferes with automatic detection of bogus M_WAITOK's. --- sys/i386/eisa/if_fea.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/i386/eisa') diff --git a/sys/i386/eisa/if_fea.c b/sys/i386/eisa/if_fea.c index d58cdc5..c0fce89 100644 --- a/sys/i386/eisa/if_fea.c +++ b/sys/i386/eisa/if_fea.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_fea.c,v 1.10 1998/08/24 02:28:15 bde Exp $ + * $Id: if_fea.c,v 1.11 1998/12/09 02:18:53 eivind Exp $ */ /* @@ -205,7 +205,11 @@ pdq_eisa_attach( irq = TAILQ_FIRST(&ed->ioconf.irqs)->irq_no; - sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); + sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT); + if (sc == NULL) { + printf("fea%d: malloc failed!\n", ed->unit); + return -1; + } pdqs_eisa[ed->unit] = sc; bzero(sc, sizeof(pdq_softc_t)); /* Zero out the softc*/ -- cgit v1.1