diff options
author | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-06-08 21:26:01 +0000 |
---|---|---|
committer | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-06-08 21:26:01 +0000 |
commit | 173b47e87fd79c3cc4619750872c1f72ccc4af6b (patch) | |
tree | 264eeee86e3b91ea61dba40c0ed78eb93eb98556 /sys/dev | |
parent | aa8cd35961caf839ca2dbfbdbc764eede2f8d777 (diff) |
Check result from malloc(9) when using M_NOWAIT. ok niklas@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/gdt_common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index be1bce61cbf..219f6dfb13e 100644 --- a/sys/dev/ic/gdt_common.c +++ b/sys/dev/ic/gdt_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.20 2002/03/14 01:26:54 millert Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.21 2002/06/08 21:26:00 nordin Exp $ */ /* * Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved. @@ -379,6 +379,8 @@ gdt_attach(gdt) gdt->sc_raw_link = malloc(gdt->sc_bus_cnt * sizeof (struct scsi_link), M_DEVBUF, M_NOWAIT); + if (gdt->sc_raw_link == NULL) + panic("gdt_attach"); bzero(gdt->sc_raw_link, gdt->sc_bus_cnt * sizeof (struct scsi_link)); for (i = 0; i < gdt->sc_bus_cnt; i++) { |