Merge "genalloc: stop crashing the system when destroying a pool"
This commit is contained in:
commit
681644be34
|
@ -177,7 +177,7 @@ int gen_pool_add_virt(struct gen_pool *pool, u64 virt, phys_addr_t phys,
|
|||
struct gen_pool_chunk *chunk;
|
||||
int nbits = size >> pool->min_alloc_order;
|
||||
int nbytes = sizeof(struct gen_pool_chunk) +
|
||||
(nbits + BITS_PER_BYTE - 1) / BITS_PER_BYTE;
|
||||
BITS_TO_LONGS(nbits) * sizeof(long);
|
||||
|
||||
if (nbytes <= PAGE_SIZE)
|
||||
chunk = kmalloc_node(nbytes, __GFP_ZERO, nid);
|
||||
|
|
Loading…
Reference in New Issue