| .. | .. |
|---|
| 43 | 43 | else if (inode > iint->inode) |
|---|
| 44 | 44 | n = n->rb_right; |
|---|
| 45 | 45 | else |
|---|
| 46 | | - break; |
|---|
| 46 | + return iint; |
|---|
| 47 | 47 | } |
|---|
| 48 | | - if (!n) |
|---|
| 49 | | - return NULL; |
|---|
| 50 | 48 | |
|---|
| 51 | | - return iint; |
|---|
| 49 | + return NULL; |
|---|
| 52 | 50 | } |
|---|
| 53 | 51 | |
|---|
| 54 | 52 | /* |
|---|
| .. | .. |
|---|
| 121 | 119 | parent = *p; |
|---|
| 122 | 120 | test_iint = rb_entry(parent, struct integrity_iint_cache, |
|---|
| 123 | 121 | rb_node); |
|---|
| 124 | | - if (inode < test_iint->inode) |
|---|
| 122 | + if (inode < test_iint->inode) { |
|---|
| 125 | 123 | p = &(*p)->rb_left; |
|---|
| 126 | | - else |
|---|
| 124 | + } else if (inode > test_iint->inode) { |
|---|
| 127 | 125 | p = &(*p)->rb_right; |
|---|
| 126 | + } else { |
|---|
| 127 | + write_unlock(&integrity_iint_lock); |
|---|
| 128 | + kmem_cache_free(iint_cache, iint); |
|---|
| 129 | + return test_iint; |
|---|
| 130 | + } |
|---|
| 128 | 131 | } |
|---|
| 129 | 132 | |
|---|
| 130 | 133 | iint->inode = inode; |
|---|