aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c5
-rw-r--r--fs/proc/kcore.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index a7310841c831..b1f6e62773d3 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -442,12 +442,13 @@ static const struct file_operations proc_lstats_operations = {
442unsigned long badness(struct task_struct *p, unsigned long uptime); 442unsigned long badness(struct task_struct *p, unsigned long uptime);
443static int proc_oom_score(struct task_struct *task, char *buffer) 443static int proc_oom_score(struct task_struct *task, char *buffer)
444{ 444{
445 unsigned long points; 445 unsigned long points = 0;
446 struct timespec uptime; 446 struct timespec uptime;
447 447
448 do_posix_clock_monotonic_gettime(&uptime); 448 do_posix_clock_monotonic_gettime(&uptime);
449 read_lock(&tasklist_lock); 449 read_lock(&tasklist_lock);
450 points = badness(task->group_leader, uptime.tv_sec); 450 if (pid_alive(task))
451 points = badness(task, uptime.tv_sec);
451 read_unlock(&tasklist_lock); 452 read_unlock(&tasklist_lock);
452 return sprintf(buffer, "%lu\n", points); 453 return sprintf(buffer, "%lu\n", points);
453} 454}
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index a44a7897fd4d..b442dac8f5f9 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -490,7 +490,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
490 } 490 }
491 read_unlock(&kclist_lock); 491 read_unlock(&kclist_lock);
492 492
493 if (m == NULL) { 493 if (&m->list == &kclist_head) {
494 if (clear_user(buffer, tsz)) 494 if (clear_user(buffer, tsz))
495 return -EFAULT; 495 return -EFAULT;
496 } else if (is_vmalloc_or_module_addr((void *)start)) { 496 } else if (is_vmalloc_or_module_addr((void *)start)) {