Use M_NOWAIT when calling malloc with a lock held.
The check for a NULL return was already in place so I assume this was just an oversight.
This commit is contained in:
parent
a18367634e
commit
d2b9185176
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241750
@ -595,7 +595,7 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p)
|
||||
#ifdef linux
|
||||
p->lut = vmalloc(n);
|
||||
#else
|
||||
p->lut = malloc(n, M_NETMAP, M_WAITOK | M_ZERO);
|
||||
p->lut = malloc(n, M_NETMAP, M_NOWAIT | M_ZERO);
|
||||
#endif
|
||||
if (p->lut == NULL) {
|
||||
D("Unable to create lookup table (%d bytes) for '%s'", n, p->name);
|
||||
@ -604,7 +604,7 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p)
|
||||
|
||||
/* Allocate the bitmap */
|
||||
n = (p->objtotal + 31) / 32;
|
||||
p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_WAITOK | M_ZERO);
|
||||
p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_NOWAIT | M_ZERO);
|
||||
if (p->bitmap == NULL) {
|
||||
D("Unable to create bitmap (%d entries) for allocator '%s'", n,
|
||||
p->name);
|
||||
|
Loading…
Reference in New Issue
Block a user