Repository navigation
[dfs][ptyfs] free pts file when unregistering - #12055
cms19859230182-lang wants to merge 1 commit into
Conversation
Fix RT-Thread#12023 In ptyfs_unregister_pts(), when a pts file is removed from the root directory list and its ptsno is returned to the bitmap pool, the allocated struct ptyfs_file was not freed, resulting in a kernel memory leak on every ptmx close. Free pts_file via rt_free() after safely detaching it from the superblock root list and returning the ptsno.
|
在 中补齐了对 的 ,避免反复注销 pts 时泄漏内核内存。 |
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-11-14 19:04 CST)
📝 Review Instructions
|
|
中文
ptyfs_unregister_pts()在注销从设备时未释放struct ptyfs_file导致的内存泄漏。English
ptyfs_unregister_pts(), free the allocatedstruct ptyfs_fileviart_free()after removing it from the root list and returning the ptsno.