LearningLinuxKernel icon indicating copy to clipboard operation
LearningLinuxKernel copied to clipboard

rbtree.c中exit函数,释放的有点。。尴尬。。

Open yifengyou opened this issue 4 years ago • 0 comments

兄弟,rbtree.c中exit函数,释放的有点。。尴尬。。

static void __exit my_exit(void) { struct mytype *data; struct rb_node *node; printk("The rbtree kernel is exiting!\n"); for (node = rb_first(&mytree); node; ) { data = rb_entry(node, struct mytype, node); if (data) { rb_erase(&data->node, &mytree); node = rb_next(node); kfree(data); } } }

Originally posted by @yifengyou in https://github.com/linuxkerneltravel/LearningLinuxKernel/issues/2#issuecomment-831656421

yifengyou avatar May 04 '21 03:05 yifengyou