Merge "genalloc: stop crashing the system when destroying a pool"

This commit is contained in:
Linux Build Service Account 2014-03-01 23:17:53 -08:00 committed by Gerrit - the friendly Code Review server
commit 681644be34
1 changed files with 1 additions and 1 deletions

View File

@ -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);