Messages in this thread Patch in this message | | | Date | Tue, 31 Dec 2002 10:18:47 -0800 | From | David Brownell <> | Subject | patch -- mempool buglet (?) |
| |
I noticed this when reading the mempool code ... looked wrong to me, it was using kfree() not the de-allocator matching the allocation it just made. This is on a fault path that likely doesn't get much use.
Compiles, untested, "looks right".
- Dave --- mm/mempool.c-dist Tue Dec 31 10:03:51 2002 +++ mm/mempool.c Tue Dec 31 10:04:24 2002 @@ -142,14 +142,14 @@ element = pool->alloc(gfp_mask, pool->pool_data); if (!element) goto out; spin_lock_irqsave(&pool->lock, flags); if (pool->curr_nr < pool->min_nr) add_element(pool, element); - else - kfree(element); /* Raced */ + else /* Raced */ + pool->free(element, pool->pool_data); } out_unlock: spin_unlock_irqrestore(&pool->lock, flags); out: return 0; } | |