diff options
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r-- | kernel/kprobes.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index bee29bde6adf..993452324a1f 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -134,8 +134,7 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) | |||
134 | struct hlist_node *pos; | 134 | struct hlist_node *pos; |
135 | 135 | ||
136 | retry: | 136 | retry: |
137 | hlist_for_each(pos, &kprobe_insn_pages) { | 137 | hlist_for_each_entry(kip, pos, &kprobe_insn_pages, hlist) { |
138 | kip = hlist_entry(pos, struct kprobe_insn_page, hlist); | ||
139 | if (kip->nused < INSNS_PER_PAGE) { | 138 | if (kip->nused < INSNS_PER_PAGE) { |
140 | int i; | 139 | int i; |
141 | for (i = 0; i < INSNS_PER_PAGE; i++) { | 140 | for (i = 0; i < INSNS_PER_PAGE; i++) { |
@@ -214,9 +213,8 @@ static int __kprobes collect_garbage_slots(void) | |||
214 | if (check_safety() != 0) | 213 | if (check_safety() != 0) |
215 | return -EAGAIN; | 214 | return -EAGAIN; |
216 | 215 | ||
217 | hlist_for_each_safe(pos, next, &kprobe_insn_pages) { | 216 | hlist_for_each_entry_safe(kip, pos, next, &kprobe_insn_pages, hlist) { |
218 | int i; | 217 | int i; |
219 | kip = hlist_entry(pos, struct kprobe_insn_page, hlist); | ||
220 | if (kip->ngarbage == 0) | 218 | if (kip->ngarbage == 0) |
221 | continue; | 219 | continue; |
222 | kip->ngarbage = 0; /* we will collect all garbages */ | 220 | kip->ngarbage = 0; /* we will collect all garbages */ |
@@ -235,8 +233,7 @@ void __kprobes free_insn_slot(kprobe_opcode_t * slot, int dirty) | |||
235 | struct kprobe_insn_page *kip; | 233 | struct kprobe_insn_page *kip; |
236 | struct hlist_node *pos; | 234 | struct hlist_node *pos; |
237 | 235 | ||
238 | hlist_for_each(pos, &kprobe_insn_pages) { | 236 | hlist_for_each_entry(kip, pos, &kprobe_insn_pages, hlist) { |
239 | kip = hlist_entry(pos, struct kprobe_insn_page, hlist); | ||
240 | if (kip->insns <= slot && | 237 | if (kip->insns <= slot && |
241 | slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) { | 238 | slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) { |
242 | int i = (slot - kip->insns) / MAX_INSN_SIZE; | 239 | int i = (slot - kip->insns) / MAX_INSN_SIZE; |