Do not return a buddy allocation on itself

parent dde10660
......@@ -1528,6 +1528,7 @@ fellow_cache_obj_free(const struct fellow_cache *fc,
{
struct fellow_cache_obj *fco;
struct fellow_cache_seg *fcs;
struct buddy_ptr_page mem;
TAKE_OBJ_NOTNULL(fco, fcop, FELLOW_CACHE_OBJ_MAGIC);
......@@ -1557,9 +1558,10 @@ fellow_cache_obj_free(const struct fellow_cache *fc,
fellow_cache_seg_free(fc, fcs, 0);
if (fco->fco_mem.bits) {
assert(fco->fco_mem.ptr == fco);
buddy_return1_ptr_page(fc->membuddy, &fco->fco_mem);
TAKE(mem, fco->fco_mem);
if (mem.bits) {
assert(mem.ptr == fco);
buddy_return1_ptr_page(fc->membuddy, &mem);
}
}
......
Markdown is supported
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