Commit c80e7a82 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds
Browse files

permit mempool_free(NULL)

Christian Borntraeger points out that mempool_free() doesn't noop when
handed NULL.  This is inconsistent with the other free-like functions
in the kernel.
Signed-off-by: default avatarRusty Russell <>
Cc: Christian Borntraeger <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5e70030d
......@@ -263,6 +263,9 @@ void mempool_free(void *element, mempool_t *pool)
unsigned long flags;
if (unlikely(element == NULL))
if (pool->curr_nr < pool->min_nr) {
spin_lock_irqsave(&pool->lock, flags);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment