aboutsummaryrefslogtreecommitdiff
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-08-14 10:39:12 -0700
committerKevin Hilman <khilman@linaro.org>2015-08-14 10:39:12 -0700
commit373cea9e2c9c6495a80efdae55cf2114f384a75b (patch)
tree7a8c31aff389cd60937edf7d311c2d93d42a3c7d /kernel/printk/printk.c
parentea64087da6e7655f5acac074a70496b50b310a29 (diff)
parent8a7eb06341c73248d152a2a12e4f00f472295de7 (diff)
Merge branch 'linux-linaro-lsk-v3.14' into linux-linaro-lsk-v3.14-rtlsk-v3.14-15.08-rt
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r--kernel/printk/printk.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index a9be229cb5af..0b47939efd62 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -383,11 +383,11 @@ static int check_syslog_permissions(int type, bool from_file)
* already done the capabilities checks at open time.
*/
if (from_file && type != SYSLOG_ACTION_OPEN)
- return 0;
+ goto ok;
if (syslog_action_restricted(type)) {
if (capable(CAP_SYSLOG))
- return 0;
+ goto ok;
/*
* For historical reasons, accept CAP_SYS_ADMIN too, with
* a warning.
@@ -397,10 +397,11 @@ static int check_syslog_permissions(int type, bool from_file)
"CAP_SYS_ADMIN but no CAP_SYSLOG "
"(deprecated).\n",
current->comm, task_pid_nr(current));
- return 0;
+ goto ok;
}
return -EPERM;
}
+ok:
return security_syslog(type);
}
@@ -1151,10 +1152,6 @@ int do_syslog(int type, char __user *buf, int len, bool from_file)
if (error)
goto out;
- error = security_syslog(type);
- if (error)
- return error;
-
switch (type) {
case SYSLOG_ACTION_CLOSE: /* Close log */
break;