From: Adrian Bunk This patch removes dead code spotted by the Coverity checker (look at the "(nbytes >= PATH_MAX)" check). Signed-off-by: Adrian Bunk Cc: Paul Jackson Cc: Paul Menage Signed-off-by: Andrew Morton --- kernel/cgroup.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff -puN kernel/cgroup.c~kernel-cgroupc-remove-dead-code kernel/cgroup.c --- a/kernel/cgroup.c~kernel-cgroupc-remove-dead-code +++ a/kernel/cgroup.c @@ -1355,16 +1355,14 @@ static ssize_t cgroup_common_file_write( if (nbytes && (buffer[nbytes-1] == '\n')) { buffer[nbytes-1] = 0; } - if (nbytes < sizeof(root->release_agent_path)) { - /* We never write anything other than '\0' - * into the last char of release_agent_path, - * so it always remains a NUL-terminated - * string */ - strncpy(root->release_agent_path, buffer, nbytes); - root->release_agent_path[nbytes] = 0; - } else { - retval = -ENOSPC; - } + + /* We never write anything other than '\0' + * into the last char of release_agent_path, + * so it always remains a NUL-terminated + * string */ + strncpy(root->release_agent_path, buffer, nbytes); + root->release_agent_path[nbytes] = 0; + break; } default: _