aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl_binary.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-05-03 03:17:01 -0400
committerIngo Molnar <mingo@elte.hu>2010-05-03 03:17:01 -0400
commit53ba4f2fa73225113a488584df0d85d3cba52943 (patch)
treed85b984d9818abc3ccc0237eb53b710d9e96c39e /kernel/sysctl_binary.c
parentbd6d29c25bb1a24a4c160ec5de43e0004e01f72b (diff)
parent66f41d4c5c8a5deed66fdcc84509376c9a0bf9d8 (diff)
Merge commit 'v2.6.34-rc6' into core/locking
Diffstat (limited to 'kernel/sysctl_binary.c')
-rw-r--r--kernel/sysctl_binary.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
index 8f5d16e0707a..59030570f5ca 100644
--- a/kernel/sysctl_binary.c
+++ b/kernel/sysctl_binary.c
@@ -13,6 +13,7 @@
13#include <linux/file.h> 13#include <linux/file.h>
14#include <linux/ctype.h> 14#include <linux/ctype.h>
15#include <linux/netdevice.h> 15#include <linux/netdevice.h>
16#include <linux/slab.h>
16 17
17#ifdef CONFIG_SYSCTL_SYSCALL 18#ifdef CONFIG_SYSCTL_SYSCALL
18 19
@@ -1331,7 +1332,7 @@ static ssize_t binary_sysctl(const int *name, int nlen,
1331 ssize_t result; 1332 ssize_t result;
1332 char *pathname; 1333 char *pathname;
1333 int flags; 1334 int flags;
1334 int acc_mode, fmode; 1335 int acc_mode;
1335 1336
1336 pathname = sysctl_getname(name, nlen, &table); 1337 pathname = sysctl_getname(name, nlen, &table);
1337 result = PTR_ERR(pathname); 1338 result = PTR_ERR(pathname);
@@ -1342,15 +1343,12 @@ static ssize_t binary_sysctl(const int *name, int nlen,
1342 if (oldval && oldlen && newval && newlen) { 1343 if (oldval && oldlen && newval && newlen) {
1343 flags = O_RDWR; 1344 flags = O_RDWR;
1344 acc_mode = MAY_READ | MAY_WRITE; 1345 acc_mode = MAY_READ | MAY_WRITE;
1345 fmode = FMODE_READ | FMODE_WRITE;
1346 } else if (newval && newlen) { 1346 } else if (newval && newlen) {
1347 flags = O_WRONLY; 1347 flags = O_WRONLY;
1348 acc_mode = MAY_WRITE; 1348 acc_mode = MAY_WRITE;
1349 fmode = FMODE_WRITE;
1350 } else if (oldval && oldlen) { 1349 } else if (oldval && oldlen) {
1351 flags = O_RDONLY; 1350 flags = O_RDONLY;
1352 acc_mode = MAY_READ; 1351 acc_mode = MAY_READ;
1353 fmode = FMODE_READ;
1354 } else { 1352 } else {
1355 result = 0; 1353 result = 0;
1356 goto out_putname; 1354 goto out_putname;
@@ -1361,7 +1359,7 @@ static ssize_t binary_sysctl(const int *name, int nlen,
1361 if (result) 1359 if (result)
1362 goto out_putname; 1360 goto out_putname;
1363 1361
1364 result = may_open(&nd.path, acc_mode, fmode); 1362 result = may_open(&nd.path, acc_mode, flags);
1365 if (result) 1363 if (result)
1366 goto out_putpath; 1364 goto out_putpath;
1367 1365