diff options
Diffstat (limited to 'fs/ubifs/debug.c')
-rw-r--r-- | fs/ubifs/debug.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index cc1febd8fadf..5157b866a853 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -2118,26 +2118,10 @@ out_free: | |||
2118 | */ | 2118 | */ |
2119 | static void free_inodes(struct fsck_data *fsckd) | 2119 | static void free_inodes(struct fsck_data *fsckd) |
2120 | { | 2120 | { |
2121 | struct rb_node *this = fsckd->inodes.rb_node; | 2121 | struct fsck_inode *fscki, *n; |
2122 | struct fsck_inode *fscki; | ||
2123 | 2122 | ||
2124 | while (this) { | 2123 | rbtree_postorder_for_each_entry_safe(fscki, n, &fsckd->inodes, rb) |
2125 | if (this->rb_left) | 2124 | kfree(fscki); |
2126 | this = this->rb_left; | ||
2127 | else if (this->rb_right) | ||
2128 | this = this->rb_right; | ||
2129 | else { | ||
2130 | fscki = rb_entry(this, struct fsck_inode, rb); | ||
2131 | this = rb_parent(this); | ||
2132 | if (this) { | ||
2133 | if (this->rb_left == &fscki->rb) | ||
2134 | this->rb_left = NULL; | ||
2135 | else | ||
2136 | this->rb_right = NULL; | ||
2137 | } | ||
2138 | kfree(fscki); | ||
2139 | } | ||
2140 | } | ||
2141 | } | 2125 | } |
2142 | 2126 | ||
2143 | /** | 2127 | /** |