lkml.org 
[lkml]   [2002]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subjectpatch -- 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;
    }
    \
     
     \ /
      Last update: 2005-03-22 13:32    [W:5.943 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site