diff options
author | bde <bde@FreeBSD.org> | 1999-01-01 12:35:47 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-01-01 12:35:47 +0000 |
commit | 1e49b19cb0720459eb397cd5d471a7777f4c27c8 (patch) | |
tree | e227434303ff34cb22e845ad730642bb2bdd57b4 /sys/i386/eisa | |
parent | 2eadc003f43b642e690481e5a4f416af2cd077bc (diff) | |
download | FreeBSD-src-1e49b19cb0720459eb397cd5d471a7777f4c27c8.zip FreeBSD-src-1e49b19cb0720459eb397cd5d471a7777f4c27c8.tar.gz |
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.
Diffstat (limited to 'sys/i386/eisa')
-rw-r--r-- | sys/i386/eisa/if_fea.c | 8 |
1 files changed, 6 insertions, 2 deletions
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*/ |