mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Use M_NOWAIT instead of M_WAITOK when allocating dmamaps; the allocations
functions may be called from a device strategy routine when sleeping is bad. Submitted by: phk Reviewed by: tmm
This commit is contained in:
parent
a88b260a86
commit
c7f73b67b5
1 changed files with 7 additions and 4 deletions
|
|
@ -268,9 +268,12 @@ nexus_dmamap_create(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, int flags,
|
|||
{
|
||||
|
||||
/* Not much to do...? */
|
||||
*mapp = malloc(sizeof(**mapp), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
ddmat->map_count++;
|
||||
return (0);
|
||||
*mapp = malloc(sizeof(**mapp), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (*mapp != NULL) {
|
||||
ddmat->map_count++;
|
||||
return (0);
|
||||
} else
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -422,7 +425,7 @@ int
|
|||
sparc64_dmamem_alloc_map(bus_dma_tag_t dmat, bus_dmamap_t *mapp)
|
||||
{
|
||||
|
||||
*mapp = malloc(sizeof(**mapp), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
*mapp = malloc(sizeof(**mapp), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (*mapp == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue