diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 9e28356a959a..aa63d25157b8 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -985,7 +985,7 @@ static ssize_t oom_score_adj_read(struct file *file, char __user *buf, | |||
985 | { | 985 | { |
986 | struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); | 986 | struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); |
987 | char buffer[PROC_NUMBUF]; | 987 | char buffer[PROC_NUMBUF]; |
988 | int oom_score_adj = OOM_SCORE_ADJ_MIN; | 988 | short oom_score_adj = OOM_SCORE_ADJ_MIN; |
989 | unsigned long flags; | 989 | unsigned long flags; |
990 | size_t len; | 990 | size_t len; |
991 | 991 | ||
@@ -996,7 +996,7 @@ static ssize_t oom_score_adj_read(struct file *file, char __user *buf, | |||
996 | unlock_task_sighand(task, &flags); | 996 | unlock_task_sighand(task, &flags); |
997 | } | 997 | } |
998 | put_task_struct(task); | 998 | put_task_struct(task); |
999 | len = snprintf(buffer, sizeof(buffer), "%d\n", oom_score_adj); | 999 | len = snprintf(buffer, sizeof(buffer), "%hd\n", oom_score_adj); |
1000 | return simple_read_from_buffer(buf, count, ppos, buffer, len); | 1000 | return simple_read_from_buffer(buf, count, ppos, buffer, len); |
1001 | } | 1001 | } |
1002 | 1002 | ||
@@ -1043,15 +1043,15 @@ static ssize_t oom_score_adj_write(struct file *file, const char __user *buf, | |||
1043 | goto err_task_lock; | 1043 | goto err_task_lock; |
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | if (oom_score_adj < task->signal->oom_score_adj_min && | 1046 | if ((short)oom_score_adj < task->signal->oom_score_adj_min && |
1047 | !capable(CAP_SYS_RESOURCE)) { | 1047 | !capable(CAP_SYS_RESOURCE)) { |
1048 | err = -EACCES; | 1048 | err = -EACCES; |
1049 | goto err_sighand; | 1049 | goto err_sighand; |
1050 | } | 1050 | } |
1051 | 1051 | ||
1052 | task->signal->oom_score_adj = oom_score_adj; | 1052 | task->signal->oom_score_adj = (short)oom_score_adj; |
1053 | if (has_capability_noaudit(current, CAP_SYS_RESOURCE)) | 1053 | if (has_capability_noaudit(current, CAP_SYS_RESOURCE)) |
1054 | task->signal->oom_score_adj_min = oom_score_adj; | 1054 | task->signal->oom_score_adj_min = (short)oom_score_adj; |
1055 | trace_oom_score_adj_update(task); | 1055 | trace_oom_score_adj_update(task); |
1056 | 1056 | ||
1057 | err_sighand: | 1057 | err_sighand: |