Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL.

This commit is contained in:
Kevin Lo 2007-03-07 05:28:42 +00:00
parent 3c419c1bb5
commit 32d6c6993c
3 changed files with 3 additions and 3 deletions

View File

@ -943,7 +943,7 @@ ds_pci_attach(device_t dev)
struct ac97_info *codec = NULL;
char status[SND_STATUSLEN];
if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO)) == NULL) {
if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) {
device_printf(dev, "cannot allocate softc\n");
return ENXIO;
}

View File

@ -1981,7 +1981,7 @@ emu_pci_attach(device_t dev)
int i, gotmic;
char status[SND_STATUSLEN];
if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO)) == NULL) {
if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) {
device_printf(dev, "cannot allocate softc\n");
return ENXIO;
}

View File

@ -1004,7 +1004,7 @@ emu_pcm_attach(device_t dev)
uint32_t inte, ipr;
uintptr_t route, r, is_emu10k1;
if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO)) == NULL) {
if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) {
device_printf(dev, "cannot allocate softc\n");
return (ENXIO);
}