hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/security/integrity/iint.c
....@@ -43,12 +43,10 @@
4343 else if (inode > iint->inode)
4444 n = n->rb_right;
4545 else
46
- break;
46
+ return iint;
4747 }
48
- if (!n)
49
- return NULL;
5048
51
- return iint;
49
+ return NULL;
5250 }
5351
5452 /*
....@@ -121,10 +119,15 @@
121119 parent = *p;
122120 test_iint = rb_entry(parent, struct integrity_iint_cache,
123121 rb_node);
124
- if (inode < test_iint->inode)
122
+ if (inode < test_iint->inode) {
125123 p = &(*p)->rb_left;
126
- else
124
+ } else if (inode > test_iint->inode) {
127125 p = &(*p)->rb_right;
126
+ } else {
127
+ write_unlock(&integrity_iint_lock);
128
+ kmem_cache_free(iint_cache, iint);
129
+ return test_iint;
130
+ }
128131 }
129132
130133 iint->inode = inode;