mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00: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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104247
@ -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 New Issue
Block a user