diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-02-07 03:13:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:17 -0500 |
commit | 3cdeed2986b09fcc77b4812ca10dbc057e4e5f8c (patch) | |
tree | e6d1880751b119358a30385a2a65deaec695f0b5 /kernel/cgroup.c | |
parent | 8f1466ff0a6e81653e9bb0d9247495bf4e9db7e2 (diff) |
kernel/cgroup.c: remove dead code
This patch removes dead code spotted by the Coverity checker
(look at the "(nbytes >= PATH_MAX)" check).
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Paul Jackson <pj@sgi.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 1a3c23936d43..ae367471b07b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1355,16 +1355,14 @@ static ssize_t cgroup_common_file_write(struct cgroup *cgrp, | |||
1355 | if (nbytes && (buffer[nbytes-1] == '\n')) { | 1355 | if (nbytes && (buffer[nbytes-1] == '\n')) { |
1356 | buffer[nbytes-1] = 0; | 1356 | buffer[nbytes-1] = 0; |
1357 | } | 1357 | } |
1358 | if (nbytes < sizeof(root->release_agent_path)) { | 1358 | |
1359 | /* We never write anything other than '\0' | 1359 | /* We never write anything other than '\0' |
1360 | * into the last char of release_agent_path, | 1360 | * into the last char of release_agent_path, |
1361 | * so it always remains a NUL-terminated | 1361 | * so it always remains a NUL-terminated |
1362 | * string */ | 1362 | * string */ |
1363 | strncpy(root->release_agent_path, buffer, nbytes); | 1363 | strncpy(root->release_agent_path, buffer, nbytes); |
1364 | root->release_agent_path[nbytes] = 0; | 1364 | root->release_agent_path[nbytes] = 0; |
1365 | } else { | 1365 | |
1366 | retval = -ENOSPC; | ||
1367 | } | ||
1368 | break; | 1366 | break; |
1369 | } | 1367 | } |
1370 | default: | 1368 | default: |