Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL.
This commit is contained in:
parent
3c419c1bb5
commit
32d6c6993c
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user