diff options
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/uprobes.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index b9c61bda902..7d5c78f063a 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -513,7 +513,6 @@ static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset) | |||
513 | uprobe->inode = igrab(inode); | 513 | uprobe->inode = igrab(inode); |
514 | uprobe->offset = offset; | 514 | uprobe->offset = offset; |
515 | init_rwsem(&uprobe->consumer_rwsem); | 515 | init_rwsem(&uprobe->consumer_rwsem); |
516 | INIT_LIST_HEAD(&uprobe->pending_list); | ||
517 | 516 | ||
518 | /* add to uprobes_tree, sorted on inode:offset */ | 517 | /* add to uprobes_tree, sorted on inode:offset */ |
519 | cur_uprobe = insert_uprobe(uprobe); | 518 | cur_uprobe = insert_uprobe(uprobe); |
@@ -1037,7 +1036,7 @@ static void build_probe_list(struct inode *inode, struct list_head *head) | |||
1037 | int uprobe_mmap(struct vm_area_struct *vma) | 1036 | int uprobe_mmap(struct vm_area_struct *vma) |
1038 | { | 1037 | { |
1039 | struct list_head tmp_list; | 1038 | struct list_head tmp_list; |
1040 | struct uprobe *uprobe, *u; | 1039 | struct uprobe *uprobe; |
1041 | struct inode *inode; | 1040 | struct inode *inode; |
1042 | int ret, count; | 1041 | int ret, count; |
1043 | 1042 | ||
@@ -1055,10 +1054,9 @@ int uprobe_mmap(struct vm_area_struct *vma) | |||
1055 | ret = 0; | 1054 | ret = 0; |
1056 | count = 0; | 1055 | count = 0; |
1057 | 1056 | ||
1058 | list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) { | 1057 | list_for_each_entry(uprobe, &tmp_list, pending_list) { |
1059 | loff_t vaddr; | 1058 | loff_t vaddr; |
1060 | 1059 | ||
1061 | list_del(&uprobe->pending_list); | ||
1062 | if (!ret) { | 1060 | if (!ret) { |
1063 | vaddr = vma_address(vma, uprobe->offset); | 1061 | vaddr = vma_address(vma, uprobe->offset); |
1064 | 1062 | ||
@@ -1106,7 +1104,7 @@ int uprobe_mmap(struct vm_area_struct *vma) | |||
1106 | void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) | 1104 | void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) |
1107 | { | 1105 | { |
1108 | struct list_head tmp_list; | 1106 | struct list_head tmp_list; |
1109 | struct uprobe *uprobe, *u; | 1107 | struct uprobe *uprobe; |
1110 | struct inode *inode; | 1108 | struct inode *inode; |
1111 | 1109 | ||
1112 | if (!atomic_read(&uprobe_events) || !valid_vma(vma, false)) | 1110 | if (!atomic_read(&uprobe_events) || !valid_vma(vma, false)) |
@@ -1123,12 +1121,10 @@ void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned lon | |||
1123 | mutex_lock(uprobes_mmap_hash(inode)); | 1121 | mutex_lock(uprobes_mmap_hash(inode)); |
1124 | build_probe_list(inode, &tmp_list); | 1122 | build_probe_list(inode, &tmp_list); |
1125 | 1123 | ||
1126 | list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) { | 1124 | list_for_each_entry(uprobe, &tmp_list, pending_list) { |
1127 | loff_t vaddr; | 1125 | loff_t vaddr; |
1128 | 1126 | ||
1129 | list_del(&uprobe->pending_list); | ||
1130 | vaddr = vma_address(vma, uprobe->offset); | 1127 | vaddr = vma_address(vma, uprobe->offset); |
1131 | |||
1132 | if (vaddr >= start && vaddr < end) { | 1128 | if (vaddr >= start && vaddr < end) { |
1133 | /* | 1129 | /* |
1134 | * An unregister could have removed the probe before | 1130 | * An unregister could have removed the probe before |