Hello, guys
struct my {
int data;
struct list_head me;
};
struct my *myp = calloc(1, sizeof(*myp));
INIT_LIST_HEAD(&myp->me);
kvlist_set(my_kv, "no1", myp);
And you can see that after kvlist_set, the me in myp has been changed! It's next and prev are still pointing to the old address.
I think it is better to give the kvlist_init a release function, and set data pointer directly.