OK, first you pass a pointer that lives inside kernel stack... Then..static int klife_open(struct inode* indode, struct file* filp) { int ret; struct klife *k;
ret = klife_alloc(&k); if (ret) return ret;
You assign memory block to this pointer. Then you get back to klife_open(). This function itself eventually exits and the kernel stack size is reduced (but not gone at the moment, esp register is just increased IIRC).static int klife_alloc(struct klife **pk) { int ret; struct klife *k;
k = kmalloc(sizeof(*k), GFP_KERNEL);
if (!k) return -ENOMEM; memset(k, 0, sizeof(*k));
ret = init_klife(k);
if (ret) kfree(k);
*pk = k;
return ret;
}
-- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ