Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262302
b: refs/heads/master
c: dfc428b
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Aug 4, 2011
1 parent 9acc499 commit 8544cf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12b3e038e5bb4860c17d001e92a6fa9964c0a7b9
refs/heads/master: dfc428b656c4693a2334a8d9865b430beddb562a
16 changes: 7 additions & 9 deletions trunk/kernel/taskstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,30 +291,28 @@ static int add_del_listener(pid_t pid, const struct cpumask *mask, int isadd)
if (!cpumask_subset(mask, cpu_possible_mask))
return -EINVAL;

s = NULL;
if (isadd == REGISTER) {
for_each_cpu(cpu, mask) {
if (!s)
s = kmalloc_node(sizeof(struct listener),
GFP_KERNEL, cpu_to_node(cpu));
s = kmalloc_node(sizeof(struct listener),
GFP_KERNEL, cpu_to_node(cpu));
if (!s)
goto cleanup;

s->pid = pid;
INIT_LIST_HEAD(&s->list);
s->valid = 1;

listeners = &per_cpu(listener_array, cpu);
down_write(&listeners->sem);
list_for_each_entry_safe(s2, tmp, &listeners->list, list) {
list_for_each_entry(s2, &listeners->list, list) {
if (s2->pid == pid)
goto next_cpu;
goto exists;
}
list_add(&s->list, &listeners->list);
s = NULL;
next_cpu:
exists:
up_write(&listeners->sem);
kfree(s); /* nop if NULL */
}
kfree(s);
return 0;
}

Expand Down

0 comments on commit 8544cf0

Please sign in to comment.