diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-17 11:24:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-17 11:24:24 -0400 |
commit | a84a79e4d369a73c0130b5858199e949432da4c6 (patch) | |
tree | e88e57ce951eeaf2780a27787ad712a09eb8be7e | |
parent | 8bc03e8f3a334e09e89a7dffb486ee97a5ce84ae (diff) |
Avoid using variable-length arrays in kernel/sys.c
The size is always valid, but variable-length arrays generate worse code
for no good reason (unless the function happens to be inlined and the
compiler sees the length for the simple constant it is).
Also, there seems to be some code generation problem on POWER, where
Henrik Bakken reports that register r28 can get corrupted under some
subtle circumstances (interrupt happening at the wrong time?). That all
indicates some seriously broken compiler issues, but since variable
length arrays are bad regardless, there's little point in trying to
chase it down.
"Just don't do that, then".
Reported-by: Henrik Grindal Bakken <henribak@cisco.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 18ee1d2f6474..1dbbe695a5ef 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1172,7 +1172,7 @@ DECLARE_RWSEM(uts_sem); | |||
1172 | static int override_release(char __user *release, int len) | 1172 | static int override_release(char __user *release, int len) |
1173 | { | 1173 | { |
1174 | int ret = 0; | 1174 | int ret = 0; |
1175 | char buf[len]; | 1175 | char buf[65]; |
1176 | 1176 | ||
1177 | if (current->personality & UNAME26) { | 1177 | if (current->personality & UNAME26) { |
1178 | char *rest = UTS_RELEASE; | 1178 | char *rest = UTS_RELEASE; |