Commit a9e68a39 authored by Vikram Narayanan's avatar Vikram Narayanan

priv_mempool: Fix off-by-one error

parent 1b9eb83f
......@@ -60,6 +60,9 @@ void construct_global_pool(priv_pool_t *p)
//printk("bundle ===> %d\n", b);
for (i = 0; i < CACHE_SIZE; i++) {
objs = (struct object*)((char*)bpool + (i * obj_size));
/* the last object's next is just null */
if (i == CACHE_SIZE - 1)
break;
objs->next = (struct object*)((char*)bpool + (i + 1) * obj_size);
// printk("\tobj %p | obj->next %p\n", objs, objs->next);
}
......
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